summaryrefslogtreecommitdiffstats
path: root/redhat/kdeadmin/trinity-kdeadmin-3.5.13.spec
blob: 66c877e978f58833f1f594ad2ed3ad14d73fd973 (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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
# If TDE is built in a specific prefix (e.g. /opt/trinity), the release will be suffixed with ".opt".
%if "%{?_prefix}" != "/usr"
%define _variant .opt
%define _docdir %{_datadir}/doc
%endif

# TDE 3.5.13 specific building variables
%define tde_docdir %{_docdir}/kde
%define tde_includedir %{_includedir}/kde
%define tde_libdir %{_libdir}/trinity


Name:			trinity-kdeadmin
Summary:		Administrative tools for TDE
Version:		3.5.13
Release:		4%{?dist}%{?_variant}

License:		GPLv2
Group:			User Interface/Desktops
BuildRoot:		%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

Vendor:			Trinity Project
Packager:		Francois Andriot <francois.andriot@free.fr>
URL:			http://www.trinitydesktop.org/

Prefix:			%{_prefix}

Source0: kdeadmin-%{version}.tar.gz
Source1: kuser.pam
Source2: kuser.pamd
Source5: kpackagerc
Source6: ksysvrc
Source7: kuserrc

# [kdeadmin/knetworkconf] Add RHEL 5, RHEL 6, Fedora 15, Fedora 16, Fedora 17
Patch1:		kdeadmin-3.5.13-add_rhel_fedora.patch

# [kdeadmin] Fix linear alphabet string errors [Commit #1f719050]
Patch2:		bp004-1f719050.diff

Requires: trinity-kdelibs
Requires: pkgconfig
Requires: usermode-gtk

BuildRequires: autoconf automake libtool m4
BuildRequires: trinity-kdelibs-devel
BuildRequires: rpm-devel

%description
The kdeadmin package includes administrative tools for the Trinity Desktop
Environment (TDE) including:
kcron, kdat, knetworkconf, kpackage, ksysv, kuser.


%prep
%setup -q -n kdeadmin

%patch1 -p1 -b .knetworkconf

# Ugly hack to modify TQT include directory inside autoconf files.
# If TQT detection fails, it fallbacks to TQT4 instead of TQT3 !
%__sed -i admin/acinclude.m4.in \
  -e "s|/usr/include/tqt|%{_includedir}/tqt|g" \
  -e "s|kde_htmldir='.*'|kde_htmldir='%{tde_docdir}/HTML'|g"

%__cp -f "/usr/share/aclocal/libtool.m4" "admin/libtool.m4.in"
%__cp -f "/usr/share/libtool/config/ltmain.sh" "admin/ltmain.sh" || %__cp -f "/usr/share/libtool/ltmain.sh" "admin/ltmain.sh"
%__make -f "admin/Makefile.common"


%build
unset QTDIR || : ; . /etc/profile.d/qt.sh
export PATH="%{_bindir}:${PATH}"
export LDFLAGS="-L%{_libdir} -I%{_includedir}"

%configure \
   --enable-new-ldflags \
   --disable-dependency-tracking \
   --disable-rpath \
   --with-rpm \
   --enable-final \
   --enable-closure \
   --with-private-groups \
   --with-extra-includes=%{_includedir}/tqt

%__make %{?_smp_mflags}

%install
export PATH="%{_bindir}:${PATH}"
%__rm -rf %{buildroot}
%__make install DESTDIR=%{buildroot}

comps="kcron kdat knetworkconf kpackage ksysv kuser"
%__mkdir_p	%{buildroot}%{_datadir}/config \
			%{buildroot}/etc/security/console.apps \
			%{buildroot}/etc/pam.d \
			%{buildroot}%{_sbindir}

%__install -p -m644 %{SOURCE5} %{SOURCE6} %{SOURCE7} %{buildroot}%{_datadir}/config/

# Run kuser through consolehelper
%__install -p -m644 %{SOURCE1} %{buildroot}/etc/security/console.apps/kuser
%__install -p -m644 %{SOURCE2} %{buildroot}/etc/pam.d/kuser
%__mv %{buildroot}%{_bindir}/kuser %{buildroot}%{_sbindir}
%__ln_s consolehelper %{buildroot}%{_bindir}/kuser

# locale's
%find_lang %{name} || touch %{name}.lang
HTML_DIR=$(kde-config --expandvars --install html)
if [ -d %{buildroot}/$HTML_DIR ]; then
for lang_dir in %{buildroot}/$HTML_DIR/* ; do
  if [ -d $lang_dir ]; then
    lang=$(basename $lang_dir)
    echo "%lang($lang) $HTML_DIR/$lang/*" >> %{name}.lang
    # replace absolute symlinks with relative ones
    pushd $lang_dir
      for i in *; do
        [ -d $i -a -L $i/common ] && ln -nsf ../common $i/common
      done
    popd
  fi
done
fi

# rpmdocs
for dir in $comps ; do
  for file in AUTHORS ChangeLog README TODO ; do
    test -s  "$dir/$file" && install -p -m644 -D "$dir/$file" "rpmdocs/$dir/$file"
  done
done

%post
for icon_theme in crystalsvg hicolor locolor ; do
  touch --no-create %{_datadir}/icons/${icon_theme} 2> /dev/null ||:
  gtk-update-icon-cache -q %{_datadir}/icons/${icon_theme} 2> /dev/null ||:
done
update-desktop-database %{_datadir}/applications > /dev/null 2>&1 || :

%postun
for icon_theme in crystalsvg hicolor locolor ; do
  touch --no-create %{_datadir}/icons/${icon_theme} 2> /dev/null ||:
  gtk-update-icon-cache -q %{_datadir}/icons/${icon_theme} 2> /dev/null ||:
done
update-desktop-database %{_datadir}/applications > /dev/null 2>&1 || :


%clean
%__rm -rf %{buildroot}


%files -f %{name}.lang
%defattr(-,root,root,-)
%doc AUTHORS COPYING README
%doc rpmdocs/*
%{_bindir}/*
%{_sbindir}/*
%config(noreplace) /etc/pam.d/*
%config(noreplace) /etc/security/console.apps/*
%{_datadir}/config*/*
%{_datadir}/mimelnk/*/*.desktop
%{_datadir}/icons/crystalsvg/*/*/*
%{_datadir}/apps/*
%{_datadir}/applications/kde/*.desktop
%{_datadir}/icons/hicolor/*/*/*
%{_datadir}/icons/locolor/*/*/*
%{_datadir}/service*/*.desktop
%{tde_libdir}/*
%{_libdir}/pkgconfig/*.pc


%changelog
* Thu Apr 03 2012 Francois Andriot <francois.andriot@free.fr> - 3.5.13-4
- Fix knetworkconf support for Fedora, adds Fedora 17
- Fix linear alphabet string errors [Commit #1f719050]
 
* Wed Jan 11 2012 Francois Andriot <francois.andriot@free.fr> - 3.5.13-3
- Add knetworkconf support for RHEL 5, RHEL 6, Fedora 15, Fedora 16
- Remove 'consolehelper' macro
- Enables all kdeadmin components in RHEL (no more exclude some tools)
- Spec file cleanup

* Fri Nov 25 2011 Francois Andriot <francois.andriot@free.fr> - 3.5.13-2
- Fix HTML directory location

* Sun Oct 30 2011 Francois Andriot <francois.andriot@free.fr> - 3.5.13-1
- Initial release for RHEL 6, RHEL 5 and Fedora 15

* Fri Oct 28 2011 Francois Andriot <francois.andriot@free.fr> - 3.5.13-0
- Import to GIT