]> git.pld-linux.org Git - packages/poldek.git/blobdiff - poldek.spec
This commit was manufactured by cvs2git to create tag 'auto-ac-poldek-
[packages/poldek.git] / poldek.spec
index 83c4345943eee4daf038b43a96867eb345616dd5..26f79e498074bb1c0b0668fcd4361b437b9d642a 100644 (file)
@@ -2,45 +2,46 @@
 # Conditional build:
 %bcond_with    static  # don't use shared libraries
 %bcond_without imode   # don't build interactive mode
-%bcond_with    curl    # link with curl
 #
 # required versions (forced to avoid SEGV with mixed db used by rpm and poldek)
-%define        ver_db  4.3.27-1
-%define        ver_rpm 4.3-0.20040107.34
+%define        ver_db  4.2.50-1
+%define        ver_rpm 4.4.1
+%define        snap    20051023.18
 Summary:       RPM packages management helper tool
 Summary(pl):   Pomocnicze narzêdzie do zarz±dzania pakietami RPM
 Name:          poldek
-Version:       0.18.9
-Release:       1.1
+Version:       0.19.0
+Release:       1.%{snap}.1
 License:       GPL v2
 Group:         Applications/System
-Source0:       http://team.pld.org.pl/~mis/poldek/download/%{name}-%{version}.tar.bz2
-# Source0-md5: c49eb9086a7ee77e50c527f9c95e41aa
+Source0:       http://team.pld.org.pl/~mis/poldek/download/snapshots/%{name}-%{version}-cvs%{snap}.tar.bz2
+# Source0-md5: 3128751c67897731c3484f0e30b49a5e
 Source1:       %{name}.conf
-Patch0:                %{name}-etc_dir.patch
-Patch1:                %{name}-retr_term.patch
-Patch2:                %{name}-simplestatic.patch
-Patch3:                %{name}-prereq.patch
+Source2:       %{name}-multilib.conf
+Source3:       %{name}-aliases.conf
 URL:           http://team.pld.org.pl/~mis/poldek/
 BuildRequires: automake
 BuildRequires: autoconf
 BuildRequires: bzip2-devel
-%{?with_curl:BuildRequires:    curl-devel >= 7.8}
 BuildRequires: db-devel >= %{ver_db}
+BuildRequires: check
 BuildRequires: gettext-autopoint
+BuildRequires: home-etc-devel
+BuildRequires: libtool
+BuildRequires: libxml2-devel
 BuildRequires: openssl-devel >= 0.9.7d
 BuildRequires: pcre-devel
 BuildRequires: perl-tools-pod
 BuildRequires: popt-devel
-BuildRequires: readline-devel
+BuildRequires: readline-devel >= 5.0
 BuildRequires: rpm-devel >= %{ver_rpm}
 BuildRequires: zlib-devel
 %if %{with static}
 BuildRequires: bzip2-static
-%{?with_curl:BuildRequires:    curl-static}
 BuildRequires: db-static >= %{ver_db}
 BuildRequires: glibc-static
 BuildRequires: libselinux-static
+BuildRequires: libxml2-static
 BuildRequires: ncurses-static
 BuildRequires: openssl-static
 BuildRequires: pcre-static
@@ -50,10 +51,12 @@ BuildRequires:      rpm-static
 BuildRequires: zlib-static
 %endif
 Requires(triggerpostun):       sed >= 4.0
+Requires(triggerpostun):       awk
+Requires:       %{name}-libs = %{version}-%{release}
 Requires:      db >= %{ver_db}
+Requires:      openssl >= 0.9.7d
 Requires:      rpm >= %{ver_rpm}
 Requires:      sed
-Requires:      openssl >= 0.9.7c
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
@@ -70,7 +73,7 @@ shell mode of Perl's CPAN.
 
 %{!?with_imode:This version hasn't got interactive mode.}
 
-#' vim
+#'
 
 %description -l pl
 poldek jest narzêdziem linii poleceñ s³u¿±cym do weryfikacji,
@@ -86,24 +89,59 @@ modu
 
 %{!?with_imode:Ta wersja nie posiada trybu interaktywnego.}
 
+%if %{without static}
+%package libs
+Summary:        poldek libraries
+Summary(pl):    Biblioteki poldka
+Group:          Libraries
+
+%description libs
+poldek library.
+
+%description libs -l pl
+Biblioteki poldka.
+%endif
+
+%package devel
+Summary:        Header files for poldek libraries
+Summary(pl):    Pliki nag³ówkowe bibliotek poldka
+Group:          Development/Libraries
+Requires:       %{name}-libs = %{version}-%{release}
+
+%description devel
+Header files for poldek libraries.
+
+%description devel -l pl
+Pliki nag³ówkowe bibliotek poldka.
+
+%package static
+Summary:        poldek static libraries
+Summary(pl):    Biblioteki statyczne poldka
+Group:          Development/Libraries
+Requires:       %{name}-devel = %{version}-%{release}
+
+%description static
+poldek static libraries.
+
+%description static -l pl
+Biblioteki statyczne poldka.
+
 %prep
-%setup -q
-%patch0 -p1
-%patch1 -p1
-%patch2 -p0
-%patch3 -p1
+%setup -q -n %{name}-%{version}-cvs%{snap}
 
 %build
 %{__autopoint}
 %{__aclocal} -I m4
 %{__autoconf}
-%{__autoheader}
 %{__automake}
 cp -f config.sub trurlib
+# glibc 2.3.5 workaround (to be removed when new snap come)
+perl -pi -e 's|HAVE_FOPENCOOKIE|HAVE_FOPENCOOKIE_XXX|g' trurlib/nstream.c
+
 %configure \
-       %{?with_static:--enable-static} \
+       %{?with_static:--enable-static --disable-shared} \
        %{!?with_imode:--disable-imode} \
-       %{?with_curl:--with-curl}
+       --enable-nls
 %{__make}
 
 %install
@@ -118,8 +156,12 @@ install -d $RPM_BUILD_ROOT%{_sysconfdir}
 #
 # CHANGE IT WHEN SWITCHING poldek.conf FROM AC TO TH !!!
 #
-%ifarch i386 i586 i686 ppc sparc alpha amd64 athlon
+%ifarch i386 i586 i686 ppc sparc alpha athlon
+%define                _ftp_arch       %{_target_cpu}
+%else
+%ifarch amd64
 %define                _ftp_arch       %{_target_cpu}
+%define                _ftp_alt_arch   i686
 %else
 %ifarch i486
 %define                _ftp_arch       i386
@@ -133,33 +175,123 @@ install -d $RPM_BUILD_ROOT%{_sysconfdir}
 %endif
 %endif
 %endif
+%endif
+
+%{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
 
-sed "s|%%ARCH%%|%{_ftp_arch}|g" < %{SOURCE1} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}.conf
+sed -e "s|%%ARCH%%|%{_ftp_arch}|g" \
+%ifarch amd64
+       -e "s|%%ALT_ARCH%%|%{_ftp_alt_arch}|g" \
+%else
+       -e '/%%ALT_ARCH%%/d' \
+%endif
+       < %{SOURCE1} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-source.conf
 
-%find_lang %{name}
+%ifarch amd64
+sed "s|%%ARCH%%|%{_ftp_alt_arch}|g" < %{SOURCE2} >> $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-source.conf
+%endif
 
-# no poldek-{devel,static}
-rm -rf $RPM_BUILD_ROOT%{_includedir}
-rm -rf $RPM_BUILD_ROOT%{_libdir}/lib*.a
-rm -rf $RPM_BUILD_ROOT%{_libdir}/libtrurl.so.0.4.0
-rm -rf $RPM_BUILD_ROOT%{_libdir}/libtrurl.la
+install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/aliases.conf
+
+# get rid of non-pld sources
+rm -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,fedora}-source.conf
+# include them in %doc
+rm -rf configs
+cp -a conf configs
+rm -f configs/Makefile*
+
+%find_lang %{name}
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
+%post
+[ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
+
+%postun
+[ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
+
+%if %{without static}
+%post  libs -p /sbin/ldconfig
+%postun        libs -p /sbin/ldconfig
+%endif
+
 %triggerpostun -- poldek <= 0.18.3-5
-sed -i -e '/^promoteepoch:.*yes/s/^/#/' %{_sysconfdir}/poldek.conf
+if [ -f /etc/poldek.conf ]; then
+       sed -i -e '/^promoteepoch:.*yes/s/^/#/' /etc/poldek.conf
+fi
 
 # otherwise don't touch
 %ifarch i386 i586 i686 ppc sparc alpha amd64 athlon
 %triggerpostun -- poldek <= 0.18.7-1
-sed -i -e 's://ftp.pld-linux.org://ftp.%{_target_cpu}.ac.pld-linux.org:g' /etc/poldek.conf
+if [ -f /etc/poldek.conf ]; then
+       sed -i -e 's://ftp.pld-linux.org://ftp.ac.pld-linux.org:g' /etc/poldek.conf
+fi
 %endif
 
+%triggerpostun -- poldek < 0.19.0-1.20050613.22.0
+if [ -f /etc/poldek.conf.rpmsave ]; then
+       awk '/^source/ {
+       name = $3;
+       path = $4;
+       auto = "yes";
+       autoup = "yes";
+       type = "pdir";
+
+       if (sub(",noauto", "", name)) {
+               auto = "no";
+       }
+
+       # skip ac sources. already in new config.
+       if (name !~ /^ac(-(ready|test|supported|updates-(general|security)))?$/) {
+               print "";
+               print "[source]";
+               print "name = " name;
+               print "type = " type;
+               print "path = " path;
+               print "auto = " auto;
+               print "autoup = " autoup;
+       }
+
+       }' < /etc/poldek.conf.rpmsave >> /etc/poldek/source.conf
+       echo "Converted old custom sources (non-ac dist ones) from /etc/poldek.conf.rpmsave to new poldek format in /etc/poldek/source.conf"
+
+       # propagate use_sudo to new config. only works for untouched poldek.conf and that's intentional.
+       if grep -q '^use_sudo.*=.*yes' /etc/poldek.conf.rpmsave; then
+               sed -i -e '/^#use sudo = no/s/^.*/use sudo = yes/' /etc/poldek/poldek.conf
+       fi
+
+       # copy hold=
+       hold=$(grep ^hold /etc/poldek.conf.rpmsave)
+       if [ "$hold" ]; then
+               sed -i -e "/^#hold =/s/^.*/$hold/" /etc/poldek/poldek.conf
+       fi
+fi
+
 %files -f %{name}.lang
 %defattr(644,root,root,755)
-%doc README* NEWS TODO *sample* conf/poldekrc*
-%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}.conf
+%doc README* NEWS TODO configs/
+%dir %{_sysconfdir}/%{name}
+%attr(644,root,root) %config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/%{name}/*.conf
 %attr(755,root,root) %{_bindir}/*
+%dir %{_libdir}/%{name}
+%attr(755,root,root) %{_libdir}/%{name}/*
 %{_mandir}/man1/%{name}*
 %lang(pl) %{_mandir}/pl/man1/%{name}*
+%{_infodir}/poldek.info*
+
+%if %{without static}
+%files libs
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/lib*.so.*.*.*
+%endif
+
+%files devel
+%defattr(644,root,root,755)
+%{!?with_static:%attr(755,root,root) %{_libdir}/lib*.so}
+%{_libdir}/lib*.la
+%{_includedir}/*
+
+%files static
+%defattr(644,root,root,755)
+%{_libdir}/lib*.a
This page took 0.0759 seconds and 4 git commands to generate.