RPM Packaging: update tdepowersave

pull/3/head
François Andriot 11 years ago
parent 9b58184067
commit cebaec407d

@ -41,10 +41,6 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Source0: %{name}-%{tde_version}%{?preversion:~%{preversion}}.tar.gz
Patch1: trinity-cmake-translations.patch
Patch2: tdepowersave-cmake-add-translation-and-documentation.patch
Patch3: tdepowersave-14.0.0-test.patch
BuildRequires: trinity-tqtinterface-devel >= %{tde_version}
BuildRequires: trinity-arts-devel >= 1:1.5.10
BuildRequires: trinity-tdelibs-devel >= %{tde_version}
@ -91,9 +87,6 @@ settings for:
%prep
%setup -q -n %{name}-%{tde_version}%{?preversion:~%{preversion}}
%patch1 -p1 -b .lang
%patch2 -p1 -b .lang
#patch3 -p1 -b .test
%build

@ -1,32 +0,0 @@
--- trinity-tdepowersave-14.0.0~pre158+340d2058/po/CMakeLists.txt 2013-08-19 06:54:55.000000000 +0200
+++ trinity-tdepowersave-14.0.0~pre158+340d2058/po/CMakeLists.txt.new 2013-08-19 19:25:41.566465666 +0200
@@ -9,9 +9,4 @@
#
#################################################
-# file( GLOB_RECURSE po_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} tdepowersave.po )
-
-foreach( _po ${po_files} )
- get_filename_component( _lang ${_po} PATH )
- tde_create_translation( FILES ${_po} LANG ${_lang} )
-endforeach( )
+tde_create_translation( LANG auto OUTPUT_NAME tdepowersave )
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake
index c257983..68fca16 100644
--- a/ConfigureChecks.cmake
+++ b/ConfigureChecks.cmake
@@ -57,6 +57,14 @@ if( NOT DBUS_TQT_FOUND )
tde_message_fatal( "dbus-tqt is required, but was not found on your system" )
endif( )
+# check for msgfmt
+if( NOT DEFINED MSGFMT_EXECUTABLE )
+ find_program( MSGFMT_EXECUTABLE msgfmt )
+ if( NOT MSGFMT_EXECUTABLE )
+ tde_message_fatal( "msgfmt program is required, but was not found on your system" )
+ endif( )
+endif( )
+
# required stuff
find_package( TQt )

@ -1,98 +0,0 @@
diff --git a/modules/TDEMacros.cmake b/modules/TDEMacros.cmake
index f290e2b..282b765 100644
--- a/cmake/modules/TDEMacros.cmake
+++ b/cmake/modules/TDEMacros.cmake
@@ -1049,6 +1049,7 @@ macro( tde_create_translation )
unset( _srcs )
unset( _lang )
unset( _dest )
+ unset( _out_name )
unset( _directive )
unset( _var )
@@ -1075,6 +1076,13 @@ macro( tde_create_translation )
set( _directive 1 )
endif( )
+ # found directive "DESTINATION"
+ if( "${_arg}" STREQUAL "OUTPUT_NAME" )
+ unset( _proj )
+ set( _var _out_name )
+ set( _directive 1 )
+ endif( )
+
# collect data
if( _directive )
unset( _directive )
@@ -1088,30 +1096,60 @@ macro( tde_create_translation )
tde_message_fatal( "MSGFMT_EXECUTABLE variable is not defined" )
elseif( NOT _lang )
tde_message_fatal( "missing LANG directive" )
- elseif( NOT _dest )
- set( _dest "${LOCALE_INSTALL_DIR}/${_lang}/LC_MESSAGES" )
endif( )
# if no file specified, include all *.po files
if( NOT _srcs )
file( GLOB _srcs RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.po )
- endif()
+ endif( )
if( NOT _srcs )
tde_message_fatal( "no source files" )
- endif()
+ endif( )
+
+ if( NOT _lang STREQUAL "auto")
+ set( _real_lang ${_lang} )
+
+ if( NOT _dest )
+ set( _dest "${LOCALE_INSTALL_DIR}/${_lang}/LC_MESSAGES" )
+ endif( )
+
+ # OUTPUT_NAME can only be used if we have only one file
+ list( LENGTH _srcs _srcs_num)
+ if( _out_name AND _srcs_num GREATER 1 )
+ tde_message_fatal( "OUTPUT_NAME can be supplied only with single file or LANG=auto" )
+ endif( )
+
+ elseif( NOT _out_name )
+ tde_message_fatal( "LANG=auto reqires OUTPUT_NAME directive to be set" )
+ elseif( _dest )
+ tde_message_fatal( "DESTINATION cannot be used with LANG=auto" )
+ endif( )
# generate *.mo files
foreach( _src ${_srcs} )
+
get_filename_component( _src ${_src} ABSOLUTE )
- get_filename_component( _out ${_src} NAME_WE )
- set( _out_name "${_out}-${_lang}.mo" )
- set( _out_real_name "${_out}.mo" )
+
+ if( _out_name )
+ set( _out ${_out_name} )
+ if( _lang STREQUAL "auto" )
+ get_filename_component( _real_lang ${_src} NAME_WE )
+ set( _dest "${LOCALE_INSTALL_DIR}/${_real_lang}/LC_MESSAGES" )
+ endif( )
+ else( )
+ get_filename_component( _out ${_src} NAME_WE )
+ endif( )
+
+ set( _out_filename "${_out}-${_real_lang}.mo" )
+ set( _install_filename "${_out}.mo" )
+
add_custom_command(
- OUTPUT ${_out_name}
- COMMAND ${MSGFMT_EXECUTABLE} ${_src} -o ${_out_name}
+ OUTPUT ${_out_filename}
+ COMMAND ${MSGFMT_EXECUTABLE} ${_src} -o ${_out_filename}
DEPENDS ${_src} )
- add_custom_target( "${_out}-${_lang}-translation" ALL DEPENDS ${_out_name} )
- install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${_out_name} RENAME ${_out_real_name} DESTINATION ${_dest} )
+ add_custom_target( "${_out}-${_real_lang}-translation" ALL DEPENDS ${_out_filename} )
+ install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${_out_filename} RENAME ${_install_filename} DESTINATION ${_dest} )
+
endforeach( )
endmacro( )

@ -54,8 +54,6 @@ Source2: ktalk
# RedHat/Fedora legacy patches
Patch4: kdenetwork-3.2.3-resolv.patch
# include more/proper ppp headers
Patch6: kdenetwork-3.5.9-krfb_httpd.patch
# [kdenetwork] Missing LDFLAGS cause FTBFS
Patch1: kdenetwork-3.5.13-missing_ldflags.patch
@ -1078,7 +1076,6 @@ update-desktop-database 2> /dev/null || :
%patch1 -p1 -b .ldflags
%patch4 -p1 -b .resolv
%patch6 -p1 -b .krfb_httpd
%if 0%{?rhel} == 4
%patch201 -p1 -b .rhel4

Loading…
Cancel
Save