summaryrefslogtreecommitdiffstats
path: root/opensuse/tde-filesystem/macros.tde
blob: b488ea8e73734702e6749ddd1aebfc88ccbcafff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
#
# Disclaimer: this was taken from macros.kde4. Some items
# are not applicable to Trinity, but are still here.
# NEW: this obsoletes common_options from kdelibs3

%_tde_prefix /opt/tde
%_tde_bindir %{_tde_prefix}/bin
%_tde_libdir %{_tde_prefix}/%{_lib}
%_tde_modulesdir %{_tde_libdir}/tde
%_tde_libexecdir %{_tde_libdir}/tde/libexec
%_tde_sysconfdir %{_sysconfdir}
%_tde_iconsdir %{_tde_prefix}/share/icons
%_tde_sbindir %{_tde_prefix}/sbin
%_tde_sharedir %{_tde_prefix}/share
%_tde_datadir %{_tde_sharedir}/apps
%_tde_appdir %{_tde_datadir}
%_tde_applicationsdir %{_tde_sharedir}/applications
%_tde_appsdir %{_tde_sharedir}/applnk
%_tde_configdir %{_tde_sharedir}/config
%_tde_configkcfgdir %{_tde_sharedir}/config.kcfg
%_tde_servicesdir %{_tde_sharedir}/services
%_tde_servicetypesdir %{_tde_sharedir}/servicetypes
%_tde_includedir %{_tde_prefix}/include
%_tde_docdir %{_tde_sharedir}/doc/
%_tde_htmldir %{_tde_sharedir}/doc/HTML
%_tde_wallpapersdir %{_tde_sharedir}/wallpapers
%_tde_icondir %{_tde_sharedir}/icons
%_tde_sounddir %{_tde_sharedir}/sounds
%_tde_locale %{_tde_sharedir}/locale
%_tde_mimedir %{_tde_sharedir}/mimelnk
%_tde_styledir %{_tde_libdir}/tde/plugins/styles
%_tde_widgetdir %{_tde_libdir}/tde/plugins/designer
 
# these are for backwards compatibility
%_kde3_prefix %{_tde_prefix}
%_kde3_libdir %{_tde_libdir}
%_kde3_share_dir %{_tde_sharedir}
%_kde3_config_dir %{_tde_configdir}
%_kde3_html_dir %{_tde_htmldir}
%_tde_modules %{_tde_modulesdir}
%_tde_servicetypes %{_tde_servicetypesdir}
 
%_tde_platform_version 3.5.13
 
%tde_runtime_requires Requires: tdebase3-runtime >= %_tde_platform_version qt3 >= 3.3.8c
 
%_tde_build_type release
 
%cmake_tde(d:) \
  export CFLAGS=$RPM_OPT_FLAGS \
  export CXXFLAGS=$RPM_OPT_FLAGS \
  export LDFLAGS="-Wl,-Bsymbolic-functions $LDFLAGS" \
  _tde_libsuffix=$(echo %_lib | cut -b4-) \
  bdir=. \
  %{-d:dir=%{-d*} \
  mkdir $dir \
  cd $dir \
  bdir=.. } \
  cmake -DCMAKE_SKIP_RPATH=ON \\\
        -DCMAKE_INSTALL_PREFIX=%{_tde_prefix} \\\
        -DCMAKE_INSTALL_LIBDIR:PATH=%{_tde_libdir} \\\
        -DINCLUDE_INSTALL_DIR:PATH=%{_tde_includedir} \\\
        -DLIB_INSTALL_DIR:PATH=%{_tde_libdir} \\\
        -DLIBEXEC_INSTALL_DIR:PATH=%{_tde_libexecdir} \\\
        -DLIB_SUFFIX="$_tde_libsuffix" \\\
        -DSYSCONF_INSTALL_DIR:PATH=%{_sysconfdir} \\\
        -DCMAKE_BUILD_TYPE=%{_tde_build_type} \\\
        -DCMAKE_VERBOSE_MAKEFILE=ON \\\
        -DQT_LIBRARY_DIRS=/usr/lib/qt3/%{_lib} \\\
        -DQT_INCLUDE_DIRS=/usr/lib/qt3/include \\\
        -DPKGCONFIG_INSTALL_DIR=%{_libdir}/pkgconfig \\\
        -DMAN_INSTALL_DIR=%{_mandir} \\\
        -DINFO_INSTALL_DIR=%{_infodir} \\\
        $bdir %* \
   if [ "$bdir" == ".." ]; then \
	cd .. \
   fi \
%{nil}

%make_tde(d:) \
  bdir=. \
  %{-d:dir=%{-d*} \
  cd $dir \
  bdir=.. } \
  make %{?_smp_mflags} VERBOSE=1 \
  if [ "$bdir" == ".." ]; then \
       cd .. \
  fi \
%{nil}

%makeinstall_tde(d:) \
  bdir=. \
  %{-d:dir=%{-d*} \
  cd $dir \
  bdir=.. } \
  make DESTDIR=%{?buildroot:%{buildroot}} install VERBOSE=1 \
  if [ "$bdir" == ".." ]; then \
       cd .. \
  fi \
%{nil}
 
%tde_post_install \
	# remove not needed development files
	rm -f $RPM_BUILD_ROOT/%{_tde_libdir}/libkdeinit_*.la \
	# not worth the hassle
	rm -rf $RPM_BUILD_ROOT/%{_tde_icondir}/locolor \
	# move icons in one theme - prefering hicolor
	d="$RPM_BUILD_ROOT/%{_tde_icondir}/crystalsvg" \
        if [ -d "$d" -a ! -e "$d/index.theme" ]; then \
		find "$d" -type f | while read src; do \
		  dest="${src/\/crystalsvg\///hicolor/}" \
		  dir="${dest%/*}" \
		  mkdir -p "$dir" \
		  mv "$src" "$dest" \
		done \
	fi \
	# we do this 3 times as there is a 3 fold hierarchy
        if [ -d  $RPM_BUILD_ROOT/%{_tde_icondir} ]; then \
  	    for i in `seq 1 3`; do \
    	        find $RPM_BUILD_ROOT/%{_tde_icondir} -type d -exec rmdir -v --ignore-fail-on-non-empty -- {} \; || true \
  	    done \
	fi \
	if [ -d $RPM_BUILD_ROOT/%{_tde_locale}/sr@Latn ]; then \
             mv $RPM_BUILD_ROOT/%{_tde_locale}/sr@Latn $RPM_BUILD_ROOT/%{_tde_locale}/sr@latin \
        fi \
        if test -e /usr/lib/rpm/suse_update_desktop_file.sh; then \
		distribution='' \
		if test -f $HOME/.rpmmacros && test -d /usr/src/packages/SRPMS; then \
			distribution=`grep ^%distribution $HOME/.rpmmacros | cut '-d ' -f2` \
		fi \
		find $RPM_BUILD_ROOT/opt/kde3/share \\\
			-name '*.desktop' 2> /dev/null | while read file; do \
			test -r "$file" || continue \
			grep -q "^X-SuSE-translate=" "$file" && continue \
			case "$file" in \
				*/.hidden/*) \
					/usr/lib/rpm/suse_update_desktop_file.sh -n "$file" \
					;; \
				 *) \
					if test -n "$distribution"; then \
						/usr/lib/rpm/suse_update_desktop_file.sh --project "$distribution" --basedir /usr/src/packages/SRPMS "$file" \
					else \
						/usr/lib/rpm/suse_update_desktop_file.sh "$file" \
					fi \
					;; \
			esac \
		done \
	fi \
%{nil}