- allow downgrade if buildtime is the same esp. if both are 0
[platform/upstream/libzypp.git] / libzypp.spec.cmake
1 #
2 # spec file for package libzypp
3 #
4 # Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
5 # This file and all modifications and additions to the pristine
6 # package are under the same license as the package itself.
7 #
8 # Please submit bugfixes or comments via http://bugs.opensuse.org/
9 #
10
11 # norootforbuild
12
13 Name:           @PACKAGE@
14 License:        GPL v2 or later
15 Group:          System/Packages
16 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
17 Autoreqprov:    on
18 Summary:        Package, Patch, Pattern, and Product Management
19 Version:        @VERSION@
20 Release:        0
21 Source:         @PACKAGE@-@VERSION@.tar.bz2
22 Source1:        @PACKAGE@-rpmlintrc
23 Prefix:         /usr
24 Provides:       yast2-packagemanager
25 Obsoletes:      yast2-packagemanager
26 BuildRequires:  cmake
27 BuildRequires:  libsatsolver-devel openssl-devel
28 BuildRequires:  boost-devel curl-devel dejagnu doxygen gcc-c++ gettext-devel graphviz hal-devel libxml2-devel
29
30 %if 0%{?suse_version}
31 BuildRequires:  hicolor-icon-theme update-desktop-files rpm-devel
32 %endif
33
34 %if 0%{?fedora_version}
35 BuildRequires: glib2-devel popt-devel dbus-glib-devel rpm-devel
36 %endif
37
38 %if 0%{?mandriva_version}
39 BuildRequires:  sqlite3-devel
40 BuildRequires:  glib2-devel
41 BuildRequires:  librpm-devel
42 %else
43 BuildRequires:  sqlite-devel
44 %endif
45
46
47
48 %if 0%{?suse_version}
49 Requires:       gpg2
50 %else
51 Requires:       gnupg
52 %endif
53
54 Requires:       satsolver-tools == %( echo `rpm -q --queryformat '%{VERSION}' satsolver-tools`)
55
56 %description
57 Package, Patch, Pattern, and Product Management
58
59 Authors:
60 --------
61     Michael Andres <ma@suse.de>
62     Jiri Srain <jsrain@suse.cz>
63     Stefan Schubert <schubi@suse.de>
64     Duncan Mac-Vicar <dmacvicar@suse.de>
65     Klaus Kaempf <kkaempf@suse.de>
66     Marius Tomaschewski <mt@suse.de>
67     Stanislav Visnovsky <visnov@suse.cz>
68     Ladislav Slezak <lslezak@suse.cz>
69
70 %package devel
71 Requires:       libzypp == @VERSION@
72 Requires:       libxml2-devel curl-devel openssl-devel rpm-devel glibc-devel zlib-devel
73 Requires:       bzip2 popt-devel dbus-1-devel glib2-devel hal-devel boost-devel libstdc++-devel
74 Requires:       cmake libsatsolver-devel
75 Summary:        Package, Patch, Pattern, and Product Management - developers files
76 Group:          System/Packages
77 Provides:       yast2-packagemanager-devel
78 Obsoletes:      yast2-packagemanager-devel
79
80 %description -n libzypp-devel
81 Package, Patch, Pattern, and Product Management - developers files
82
83 Authors:
84 --------
85     Michael Andres <ma@suse.de>
86     Jiri Srain <jsrain@suse.cz>
87     Stefan Schubert <schubi@suse.de>
88     Duncan Mac-Vicar <dmacvicar@suse.de>
89     Klaus Kaempf <kkaempf@suse.de>
90     Marius Tomaschewski <mt@suse.de>
91     Stanislav Visnovsky <visnov@suse.cz>
92     Ladislav Slezak <lslezak@suse.cz>
93
94 %prep
95 %setup -q
96
97 %build
98 mkdir build
99 cd build
100 cmake -DCMAKE_INSTALL_PREFIX=%{prefix} \
101       -DDOC_INSTALL_DIR=%{_docdir} \
102       -DLIB=%{_lib} \
103       -DCMAKE_C_FLAGS_RELEASE:STRING="%{optflags}" \
104       -DCMAKE_CXX_FLAGS_RELEASE:STRING="%{optflags}" \
105       -DCMAKE_BUILD_TYPE=Release \
106       -DCMAKE_SKIP_RPATH=1 \
107       ..
108 make %{?jobs:-j %jobs} VERBOSE=1
109 make -C doc/autodoc %{?jobs:-j %jobs}
110 make -C po %{?jobs:-j %jobs} translations
111
112 #make check
113
114 %install
115 rm -rf "$RPM_BUILD_ROOT"
116 cd build
117 make install DESTDIR=$RPM_BUILD_ROOT
118 make -C doc/autodoc install DESTDIR=$RPM_BUILD_ROOT
119 mkdir -p $RPM_BUILD_ROOT/etc/zypp/repos.d
120
121 %if 0%{?suse_version}
122 %suse_update_desktop_file -G "" -C "" package-manager
123 %endif
124
125 make -C po install DESTDIR=$RPM_BUILD_ROOT
126 # Create filelist with translations
127 cd ..
128 %{find_lang} zypp
129
130
131 %post
132 %run_ldconfig
133 if [ -f /var/cache/zypp/zypp.db ]; then rm /var/cache/zypp/zypp.db; fi
134 #%{prefix}/lib/zypp/zypp-migrate-sources
135
136 %postun
137 %run_ldconfig
138
139 %clean
140 rm -rf "$RPM_BUILD_ROOT"
141
142 %files -f zypp.lang
143 %defattr(-,root,root)
144 %dir               /etc/zypp
145 %dir               /etc/zypp/repos.d
146 %config(noreplace) /etc/zypp/zypp.conf
147 #%{prefix}/lib/zypp
148 %{prefix}/share/zypp
149 %{prefix}/share/applications/package-manager.desktop
150 %{prefix}/share/icons/hicolor/scalable/apps/package-manager-icon.svg
151 %{prefix}/share/icons/hicolor/16x16/apps/package-manager-icon.png
152 %{prefix}/share/icons/hicolor/32x32/apps/package-manager-icon.png
153 %{prefix}/share/icons/hicolor/48x48/apps/package-manager-icon.png
154 %{prefix}/bin/package-manager
155 %{prefix}/bin/package-manager-su
156 %{_libdir}/libzypp*so.*
157
158 %files devel
159 %defattr(-,root,root)
160 %{_libdir}/libzypp.so
161 #%dir %{_libdir}/libzypp.la
162 %{_docdir}/%{name}
163 %dir %{prefix}/include/zypp
164 %{prefix}/include/zypp/*
165 %{prefix}/share/cmake/Modules/*
166 %{_libdir}/pkgconfig/libzypp.pc
167
168 %changelog