]>
Commit | Line | Data |
---|---|---|
8a1725c4 | 1 | # |
2ce6e15e JB |
2 | # Conditional build: |
3 | %bcond_without gnome # don't build gnome configurator | |
8a1725c4 | 4 | # |
e99efd2f | 5 | %define _name trackpoint |
8a1725c4 | 6 | Summary: TrackPoint configuration service for IBM laptops |
f70635d2 | 7 | Summary(pl.UTF-8): Usługa konfigurująca TrackPointa do laptopów IBM |
e99efd2f | 8 | Name: configure-trackpoint |
9 | Version: 0.3.3 | |
8a1725c4 | 10 | Release: 2 |
e99efd2f | 11 | License: GPL v2 |
12 | Group: X11/Applications | |
13 | Source0: http://dl.sourceforge.net/tpctl/%{name}-%{version}.tar.gz | |
14 | # Source0-md5: 081b361f77d8510f3dab293b58d7a30d | |
15 | Source1: %{name}.init | |
16 | Patch0: %{name}-desktop.patch | |
17 | Patch1: %{name}-makefile.patch | |
2ce6e15e JB |
18 | URL: http://tpctl.sourceforge.net/ |
19 | %if %{with gnome} | |
e99efd2f | 20 | BuildRequires: autoconf |
21 | BuildRequires: automake | |
2ce6e15e JB |
22 | BuildRequires: libgnomeui-devel |
23 | BuildRequires: pkgconfig | |
24 | %endif | |
e99efd2f | 25 | Requires(post,preun): /sbin/chkconfig |
2ce6e15e JB |
26 | Requires: rc-scripts |
27 | # trackpoint subsystem via sysfs | |
28 | #Requires: uname(release) >= 2.6.11 | |
e99efd2f | 29 | ExclusiveArch: %{ix86} |
30 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
31 | ||
32 | %description | |
8a1725c4 | 33 | TrackPoint configuration service for IBM laptops. |
e99efd2f | 34 | |
53e5920d JR |
35 | %description -l pl.UTF-8 |
36 | Usługa konfigurująca TrackPointa do laptopów IBM. | |
8a1725c4 | 37 | |
38 | %package gnome | |
39 | Summary: GNOME TrackPoint configuration tool for IBM laptops | |
f70635d2 | 40 | Summary(pl.UTF-8): Narzędzie konfiguracyjne TrackPointa do laptopów IBM |
8a1725c4 | 41 | Group: X11/Applications |
42 | Requires: %{name} = %{version}-%{release} | |
43 | ||
44 | %description gnome | |
45 | GNOME TrackPoint configuration tool for IBM laptops. | |
46 | ||
53e5920d JR |
47 | %description gnome -l pl.UTF-8 |
48 | Narzędzie konfiguracyjne TrackPointa do laptopów IBM. | |
e99efd2f | 49 | |
50 | %prep | |
51 | %setup -q | |
52 | %patch0 -p1 | |
53 | %patch1 -p1 | |
54 | ||
55 | %build | |
8a1725c4 | 56 | %if %{with gnome} |
e99efd2f | 57 | %{__aclocal} |
58 | %{__autoconf} | |
59 | %{__automake} | |
60 | %configure | |
61 | %{__make} | |
8a1725c4 | 62 | %endif |
e99efd2f | 63 | |
64 | %install | |
65 | rm -rf $RPM_BUILD_ROOT | |
66 | install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,%{_sysconfdir}/%{_name}} | |
67 | ||
8a1725c4 | 68 | %if %{with gnome} |
e99efd2f | 69 | %{__make} install \ |
70 | DESTDIR=$RPM_BUILD_ROOT | |
71 | ||
8a1725c4 | 72 | ln -sf %{name}/%{_name}.png $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png |
73 | %endif | |
74 | ||
e99efd2f | 75 | install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{_name} |
76 | install etc/trackpoint/trackpoint.conf $RPM_BUILD_ROOT%{_sysconfdir}/%{_name}/%{_name}.conf | |
77 | > $RPM_BUILD_ROOT%{_sysconfdir}/%{_name}/%{_name}.conf.bak | |
e99efd2f | 78 | |
79 | %clean | |
80 | rm -rf $RPM_BUILD_ROOT | |
81 | ||
82 | %post | |
83 | /sbin/chkconfig --add %{_name} | |
84 | %service %{_name} restart | |
85 | ||
86 | %preun | |
87 | if [ "$1" = "0" ]; then | |
88 | %service -q %{_name} stop | |
89 | /sbin/chkconfig --del %{_name} | |
90 | fi | |
91 | ||
92 | %files | |
93 | %defattr(644,root,root,755) | |
94 | %doc AUTHORS ChangeLog | |
95 | %attr (754,root,root) /etc/rc.d/init.d/%{_name} | |
96 | %dir %{_sysconfdir}/%{_name} | |
97 | %attr (754,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{_name}/%{_name}.conf | |
98 | %attr (754,root,root) %ghost %{_sysconfdir}/%{_name}/%{_name}.conf.bak | |
8a1725c4 | 99 | |
100 | %if %{with gnome} | |
101 | %files gnome | |
102 | %defattr(644,root,root,755) | |
e99efd2f | 103 | %attr(755,root,root) %{_bindir}/* |
43e5e203 | 104 | %{_desktopdir}/*.desktop |
e99efd2f | 105 | %{_pixmapsdir}/* |
8a1725c4 | 106 | %endif |