cat <<EOF
-%define name fetchmail
-%define version ${1}
-%define release 1
-%define builddir \$RPM_BUILD_DIR/%{name}-%{version}
-Name: %{name}
-Version: %{version}
-Release: %{release}
+# Note: Do not hack fetchmail.spec by hand -- it's generated by specgen.sh
+Name: fetchmail
+Version: $1
+Release: 1
Vendor: Eric Conspiracy Secret Labs
Packager: Eric S. Raymond <esr@thyrsus.com>
URL: http://www.tuxedo.org/~esr/fetchmail
%setup -q
%build
-CFLAGS="$RPM_OPT_FLAGS" LDFLAGS="-s" # Add --enable-nls --without-included-gettext for internationalization
+CFLAGS="\$RPM_OPT_FLAGS" LDFLAGS="-s"
export CFLAGS LDFLAGS
-./configure -prefix=/usr
+./configure --prefix=/usr --without-kerberos --mandir=%{_mandir}
+ # Add --enable-nls --without-included-gettext
+ # for internationalization. Also look below.
make
%install
if [ -d \$RPM_BUILD_ROOT ]; then rm -rf \$RPM_BUILD_ROOT; fi
mkdir -p \$RPM_BUILD_ROOT/{etc/X11/wmconfig,usr/lib/rhs/control-panel}
-make install prefix=\$RPM_BUILD_ROOT/usr
-cp %{builddir}/rh-config/*.{xpm,init} \$RPM_BUILD_ROOT/usr/lib/rhs/control-panel
-cp %{builddir}/fetchmail.man \$RPM_BUILD_ROOT/usr/man/man1/fetchmail.1
-gzip -9nf \$RPM_BUILD_ROOT/usr/man/man1/fetchmail.1
-cd \$RPM_BUILD_ROOT/usr/man/man1
-ln -sf fetchmail.1.gz fetchmailconf.1.gz
-rm -rf %{builddir}/contrib/RCS
-chmod 644 %{builddir}/contrib/*
-cp %{builddir}/rh-config/fetchmailconf.wmconfig \$RPM_BUILD_ROOT/etc/X11/wmconfig/fetchmailconf
+make install prefix=\$RPM_BUILD_ROOT/usr mandir=\$RPM_BUILD_ROOT%{_mandir}/man1
+cp rh-config/*.{xpm,init} \$RPM_BUILD_ROOT/usr/lib/rhs/control-panel
+rm -rf contrib/RCS
+chmod 644 contrib/*
+cp rh-config/fetchmailconf.wmconfig \$RPM_BUILD_ROOT/etc/X11/wmconfig/fetchmailconf
+cd \$RPM_BUILD_ROOT%{_mandir}/man1
+ln -sf fetchmail.1 fetchmailconf.1
%clean
rm -rf \$RPM_BUILD_ROOT
%defattr (644, root, root, 755)
%doc README NEWS NOTES FAQ COPYING FEATURES sample.rcfile contrib
%doc fetchmail-features.html fetchmail-FAQ.html design-notes.html
+%attr(644, root, man) %{_mandir}/man1/*.1*
+%attr(755, root, root) /usr/bin/fetchmail
+# Uncomment the following to support internationalization
+# %attr(644,root,root) /usr/share/locale/*/LC_MESSAGES/fetchmail.mo
+# Uncomment the following to make split fetchmail and fetchmailconf packages
+# %files -n fetchmailconf
+%attr(644,root,root) /etc/X11/wmconfig/fetchmailconf
+%attr(755,root,root) /usr/bin/fetchmailconf
/usr/lib/rhs/control-panel/fetchmailconf.xpm
/usr/lib/rhs/control-panel/fetchmailconf.init
-/etc/X11/wmconfig/fetchmailconf
-%defattr (644, root, man)
-/usr/man/man1/*.1.gz
-%defattr (755, root, root)
-/usr/bin/fetchmail
-/usr/bin/fetchmailconf
EOF
-
-# Add these for internationalization
-#for file in po/*.mo
-#do
-# echo "/usr/share/locale/*/LC_MESSAGES/fetchmail.mo"
-#done