summaryrefslogtreecommitdiff
path: root/smart.spec
blob: 4a37d755bb293dc0768abdf5b2b6974c40f8c799 (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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
# TODO
# - bundled and modified software:
#  - pexpect-0.999 http://pexpect.sourceforge.net/
#
# Conditional build:
%bcond_without	kde	# without KDE support (not needed for GNOME)
#
%define	module smart
Summary:	Next generation package handling tool
Summary(pl.UTF-8):	Narzędzie do obsługi pakietów nowej generacji
Name:		smart
Version:	0.51
Release:	0.1
License:	GPL
Group:		Applications/System
Source0:	http://labix.org/download/smart/%{name}-%{version}.tar.bz2
# Source0-md5:	6584bf3b977081162d19e220fdbcb3ac
Source1:	%{name}-distro.py
Source2:	%{name}.desktop
Source3:	%{name}-kde.desktop
Patch0:		%{name}-syslibs.patch
Patch1:		%{name}-pyc.patch
Patch2:		%{name}-archscore.patch
Patch3:		%{name}-am110.patch
URL:		http://labix.org/smart/
%if %{with kde}
BuildRequires:	kdelibs-devel
%endif
BuildRequires:	libstdc++-devel
BuildRequires:	python-devel >= 1:2.3
BuildRequires:	sed >= 4.0
Requires:	python-cElementTree
Requires:	python-elementtree
Requires:	python-rpm
%pyrequires_eq  python-modules
BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)

%description
Smart Package Manager is a next generation package handling tool.

%description -l pl.UTF-8
Smart Package Manager to narzędzie do obsługi pakietów nowej
generacji.

%package update
Summary:	Allows execution of 'smart update' by normal users (suid)
Summary(pl.UTF-8):	Pakiet (suid) pozwalający wykonywać "smart update" zwykłym użytkownikom
Group:		Applications/System
Requires:	%{name} = %{version}-%{release}

%description update
Allows execution of 'smart update' by normal users through a special
suid command.

%description update -l pl.UTF-8
Ten pakiet pozwala wykonywać "smart update" zwykłym użytkownikom
poprzez specjalne polecenie suid.

%package gui
Summary:	Graphical user interface for the Smart Package Manager
Summary(pl.UTF-8):	Graficzny interfejs użytkownika do zarządcy pakietów Smart
Group:		Applications/System
Requires:	%{name} = %{version}-%{release}
Requires:	python-pygtk-gtk

%description gui
Graphical user interface for the Smart Package Manager.

%description gui -l pl.UTF-8
Graficzny interfejs użytkownika do zarządcy pakietów Smart.

%package -n ksmarttray
Summary:	KDE tray program for watching updates with Smart Package Manager
Summary(pl.UTF-8):	Program zasobnika KDE do oglądania uaktualnień przy użyciu zarządcy pakietów Smart
Group:		Applications/System
Requires:	smart-update = %{version}-%{release}

%description -n ksmarttray
KDE tray program for watching updates with Smart Package Manager.

%description -n ksmarttray -l pl.UTF-8
Program zasobnika KDE do oglądania uaktualnień przy użyciu zarządcy
pakietów Smart.

%description -n ksmarttray -l pt.UTF-8
Programa tray do KDE para verificar atualizações com o Smart Package
Manager.

%prep
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1

# %{_libdir} is hardcoded
%{__sed} -i -e's,/usr/lib/,%{_libdir}/,' smart/const.py

rm -rf smart/util/elementtree
rm -rf smart/util/celementtree
rm -f smart/util/optparse.py

%build
export CFLAGS="%{rpmcflags}"
python setup.py build

# smart-update
%{__make} -C contrib/smart-update \
	CC="%{__cc}" \
	CFLAGS="%{rpmcflags}"

%if %{with kde}
# ksmarttray
cd contrib/ksmarttray
%{__make} -f admin/Makefile.common

%configure \
%if "%{_lib}" == "lib64"
	--enable-libsuffix=64 \
%endif
	--%{?debug:en}%{!?debug:dis}able-debug%{?debug:=full} \
	--with-qt-libraries=%{_libdir}
%{__make}
%endif

%install
rm -rf $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir},%{_libdir}/smart,/var/lib/smart}
python setup.py install -O1 --root=$RPM_BUILD_ROOT

cp -f contrib/smart-update/smart-update $RPM_BUILD_ROOT%{_bindir}
install %{SOURCE2} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
install -p smart/interfaces/images/smart.png $RPM_BUILD_ROOT%{_pixmapsdir}/smart.png
# Currently needs to hardcode %{_libdir}, as this is hardcoded in the
# code, too.
install -p %{SOURCE1} $RPM_BUILD_ROOT%{_libdir}/smart/distro.py

%if %{with kde}
%{__make} -C contrib/ksmarttray install \
	DESTDIR=$RPM_BUILD_ROOT
install %{SOURCE3} $RPM_BUILD_ROOT%{_desktopdir}/%{name}-kde.desktop
%endif

%find_lang %{name}
%py_postclean

%clean
rm -rf $RPM_BUILD_ROOT

%files -f %{name}.lang
%defattr(644,root,root,755)
%doc HACKING README LICENSE TODO IDEAS
%attr(755,root,root) %{_bindir}/smart
%{_mandir}/man8/smart.8*
%{_libdir}/smart
%dir /var/lib/smart

%attr(755,root,root) %{py_sitedir}/%{module}/ccache.so
%attr(755,root,root) %{py_sitedir}/%{module}/util/cdistance.so
%attr(755,root,root) %{py_sitedir}/%{module}/util/ctagfile.so
%attr(755,root,root) %{py_sitedir}/%{module}/backends/deb/cdebver.so
%attr(755,root,root) %{py_sitedir}/%{module}/backends/rpm/crpmver.so

%dir %{py_sitedir}/%{module}
%{py_sitedir}/%{module}/*.py[co]
%dir %{py_sitedir}/%{module}/backends
%{py_sitedir}/%{module}/backends/*.py[co]
%dir %{py_sitedir}/%{module}/backends/deb
%{py_sitedir}/%{module}/backends/deb/*.py[co]
%dir %{py_sitedir}/%{module}/backends/rpm
%{py_sitedir}/%{module}/backends/rpm/*.py[co]
%dir %{py_sitedir}/%{module}/backends/slack
%{py_sitedir}/%{module}/backends/slack/*.py[co]
%dir %{py_sitedir}/%{module}/channels
%{py_sitedir}/%{module}/channels/*.py[co]
%dir %{py_sitedir}/%{module}/commands
%{py_sitedir}/%{module}/commands/*.py[co]
%dir %{py_sitedir}/%{module}/interfaces
%{py_sitedir}/%{module}/interfaces/*.py[co]
%dir %{py_sitedir}/%{module}/interfaces/images
%{py_sitedir}/%{module}/interfaces/images/*.py[co]
%{py_sitedir}/%{module}/interfaces/images/folder.png
%{py_sitedir}/%{module}/interfaces/images/package-available-locked.png
%{py_sitedir}/%{module}/interfaces/images/package-available.png
%{py_sitedir}/%{module}/interfaces/images/package-broken.png
%{py_sitedir}/%{module}/interfaces/images/package-downgrade.png
%{py_sitedir}/%{module}/interfaces/images/package-install.png
%{py_sitedir}/%{module}/interfaces/images/package-installed-locked.png
%{py_sitedir}/%{module}/interfaces/images/package-installed-outdated.png
%{py_sitedir}/%{module}/interfaces/images/package-installed.png
%{py_sitedir}/%{module}/interfaces/images/package-new-locked.png
%{py_sitedir}/%{module}/interfaces/images/package-new.png
%{py_sitedir}/%{module}/interfaces/images/package-purge.png
%{py_sitedir}/%{module}/interfaces/images/package-reinstall.png
%{py_sitedir}/%{module}/interfaces/images/package-remove.png
%{py_sitedir}/%{module}/interfaces/images/package-upgrade.png
%{py_sitedir}/%{module}/interfaces/images/smart.png
%dir %{py_sitedir}/%{module}/interfaces/text
%{py_sitedir}/%{module}/interfaces/text/*.py[co]
%dir %{py_sitedir}/%{module}/plugins
%{py_sitedir}/%{module}/plugins/*.py[co]
%dir %{py_sitedir}/%{module}/util
%{py_sitedir}/%{module}/util/*.py[co]

%files update
%defattr(644,root,root,755)
%attr(755,root,root) %{_bindir}/smart-update

%files gui
%defattr(644,root,root,755)
%dir %{py_sitedir}/%{module}/interfaces/gtk
%{py_sitedir}/%{module}/interfaces/gtk/*.py[co]
%{_desktopdir}/smart.desktop
%if %{with kde}
%{_desktopdir}/smart-kde.desktop
%endif
%{_pixmapsdir}/smart.png

%if %{with kde}
%files -n ksmarttray
%defattr(644,root,root,755)
%attr(775,root,root) %{_bindir}/ksmarttray
%{_datadir}/apps/ksmarttray
%endif