Revamp the RPM building process. For versions of rpm that support

"--define", we now build the RPM and SRPM packages in packages/rpm.
As a result, one need not be root to build RPM-based packages.

Move the specfile to packaging/rpm/SPECS.

Update the INSTALL document to include the various packaging makefile
targets.

svn path=/trunk/; revision=4581
This commit is contained in:
Gerald Combs 2002-01-20 23:05:25 +00:00
parent 287425df9c
commit b11f1955e4
7 changed files with 68 additions and 54 deletions

23
INSTALL
View File

@ -50,9 +50,9 @@ Installation Checklist
that have already been captured to disk by other programs. that have already been captured to disk by other programs.
You can build or not build ethereal, tethereal, editcap, and You can build or not build ethereal, tethereal, editcap, and
mergecap with the appropriate --enable-XXX or --disable-XXX flags. mergecap with the appropriate --enable-XXX or --disable-XXX
The default is to build everything. If GTK+ is not detected flags. The default is to build everything. If GTK+ is not
on the system, then ethereal won't be built. detected on the system, then ethereal won't be built.
[ ] 4. Run 'make'. Hopefully, you won't run into any problems. [ ] 4. Run 'make'. Hopefully, you won't run into any problems.
@ -60,4 +60,19 @@ Installation Checklist
have root privileges in order to capture live data. have root privileges in order to capture live data.
[ ] 6. Run 'make install'. If you wish to install the man page, run [ ] 6. Run 'make install'. If you wish to install the man page, run
'make install-man'. You're done. 'make install-man'. If you're running a system that supports
the Apt, RPM, or System V Release 4 packaging systems, you can
run one of
make debian-package # Builds a binary package using dpkg
make rpm-package # Builds a binary package using rpm
make srpm-package # Builds a source package using rpm
make svr4-package # Builds a source package using pkgmk
make solaris-package # Same as "make svr4-package"
to make an installable package for your system.
If you have trouble with the build or installation process, you can
find assistance on the ethereal-users and ethereal-dev mailing lists.
See http://www.ethereal.com/lists/ for details.

View File

@ -1,7 +1,7 @@
# Makefile.am # Makefile.am
# Automake file for Ethereal # Automake file for Ethereal
# #
# $Id: Makefile.am,v 1.404 2002/01/10 01:28:43 guy Exp $ # $Id: Makefile.am,v 1.405 2002/01/20 23:05:22 gerald Exp $
# #
# Ethereal - Network traffic analyzer # Ethereal - Network traffic analyzer
# By Gerald Combs <gerald@ethereal.com> # By Gerald Combs <gerald@ethereal.com>
@ -969,24 +969,30 @@ svr4-package: $(bin_SCRIPTS) $(lib_LTLIBRARIES)
solaris-package: svr4-package solaris-package: svr4-package
specfile=$(top_srcdir)/packaging/rpm/ethereal.spec rpm_topdir=`cd $(top_srcdir) && pwd`/packaging/rpm
rpm-package: dist rpm-package: dist
if test x$(HAVE_RPM_PACKAGING) = xyes ; then \ if test x$(HAVE_RPM) = xyes ; then \
cp $(top_srcdir)/$(distdir).tar.gz $(RPM_SOURCEDIR) ; \ cd $(rpm_topdir) ; \
rpm -bb --clean --rmsource $(specfile) ; \ mkdir BUILD RPMS SOURCES ; \
cd SOURCES ; \
ln -s ../../../$(distdir).tar.gz ; \
cd .. ; \
rpm --define "_topdir `cd . && pwd`" -bb SPECS/ethereal.spec && \
echo "Package successfully built in `pwd`/RPMS." ; \
else \ else \
echo "Error: RPM executable and/or source directory not found." ; \ echo "Error: RPM executable and/or source directory not found." ; \
echo "Package build abandoned." ; \
fi fi
srpm-package: dist srpm-package: dist
if test x$(HAVE_RPM_PACKAGING) = xyes ; then \ if test x$(HAVE_RPM) = xyes ; then \
cp $(top_srcdir)/$(distdir).tar.gz $(RPM_SOURCEDIR) ; \ cd $(rpm_topdir) ; \
rpm -bs --clean --rmsource $(specfile) ; \ mkdir BUILD SRPMS SOURCES ; \
cd SOURCES ; \
ln -s ../../../$(distdir).tar.gz ; \
cd .. ; \
rpm --define "_topdir `cd . && pwd`" -bs SPECS/ethereal.spec && \
echo "Package successfully built in `pwd`/SRPMS." ; \
else \ else \
echo "Error: RPM executable and/or source directory not found." ; \ echo "Error: RPM executable and/or source directory not found." ; \
echo "Package build abandoned." ; \
fi fi
debian-package: debian/rules debian-package: debian/rules

View File

@ -2,7 +2,7 @@ dnl Macros that test for specific features.
dnl This file is part of the Autoconf packaging for Ethereal. dnl This file is part of the Autoconf packaging for Ethereal.
dnl Copyright (C) 1998-2000 by Gerald Combs. dnl Copyright (C) 1998-2000 by Gerald Combs.
dnl dnl
dnl $Id: acinclude.m4,v 1.37 2002/01/18 08:28:22 guy Exp $ dnl $Id: acinclude.m4,v 1.38 2002/01/20 23:05:22 gerald Exp $
dnl dnl
dnl This program is free software; you can redistribute it and/or modify dnl This program is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by dnl it under the terms of the GNU General Public License as published by
@ -492,3 +492,23 @@ AC_DEFUN(AC_ETHEREAL_SSL_CHECK,
AC_MSG_RESULT(not required) AC_MSG_RESULT(not required)
fi fi
]) ])
#
# AC_ETHEREAL_RPM_CHECK
# Looks for the rpm program, and checks to see if we can redefine "_topdir".
#
AC_DEFUN(AC_ETHEREAL_RPM_CHECK,
[
AC_CHECK_PROG(ac_cv_ethereal_have_rpm, rpm, "yes", "no")
if test "x$ac_cv_ethereal_have_rpm" = "xyes"; then
rpm --define '_topdir /tmp' > /dev/null 2>&1
AC_MSG_CHECKING(to see if we can redefine _topdir)
if test $? -eq 0 ; then
AC_MSG_RESULT(yes)
HAVE_RPM=yes
else
AC_MSG_RESULT(no. You'll have to build packages manually.)
HAVE_RPM=no
fi
fi
])

View File

@ -1,4 +1,4 @@
# $Id: configure.in,v 1.144 2002/01/09 23:21:54 gram Exp $ # $Id: configure.in,v 1.145 2002/01/20 23:05:22 gerald Exp $
dnl dnl
dnl Process this file with autoconf 2.13 or later to produce a dnl Process this file with autoconf 2.13 or later to produce a
dnl configure script; 2.12 doesn't generate a "configure" script that dnl configure script; 2.12 doesn't generate a "configure" script that
@ -38,7 +38,6 @@ AC_SUBST(PYTHON)
AC_CHECK_PROG(HAVE_PKGPROTO, pkgproto, "yes", "no") AC_CHECK_PROG(HAVE_PKGPROTO, pkgproto, "yes", "no")
AC_CHECK_PROG(HAVE_PKGMK, pkgmk, "yes", "no") AC_CHECK_PROG(HAVE_PKGMK, pkgmk, "yes", "no")
AC_CHECK_PROG(HAVE_PKGTRANS, pkgtrans, "yes", "no") AC_CHECK_PROG(HAVE_PKGTRANS, pkgtrans, "yes", "no")
AC_CHECK_PROG(HAVE_RPM, rpm, "yes", "no")
if test x$HAVE_PKGPROTO = xyes -a x$HAVE_PKGMK = xyes \ if test x$HAVE_PKGPROTO = xyes -a x$HAVE_PKGMK = xyes \
-a x$HAVE_PKGTRANS = xyes ; then -a x$HAVE_PKGTRANS = xyes ; then
@ -48,38 +47,8 @@ else
fi fi
AC_SUBST(HAVE_SVR4_PACKAGING) AC_SUBST(HAVE_SVR4_PACKAGING)
# Grr. Rpm 2.x has a nifty "--showrc" flag that lists all of the current AC_ETHEREAL_RPM_CHECK
# configuration values. Version 3.x took the niftiness away by returning AC_SUBST(HAVE_RPM)
# the values in their raw, unexpanded, macro-embedded form. We can either
# try to expand the values we get from 3.x, or poke around for popular build
# directories.
HAVE_RPM_PACKAGING=no
if test x$HAVE_RPM = xyes ; then
AC_MSG_CHECKING(for rpm build directories)
RPM_SOURCESDIR=`rpm --showrc | grep "^sourcedir" | \
sed -e 's/.*: //' 2> /dev/null`
if test x$RPM_SPECDIR = x ; then
# Red Hat : /usr/src/redhat
# Mandrake : /usr/scr/rpm
# SuSE : /usr/src/packages
for TEST_DIR in /usr/src/redhat /usr/src/rpm /usr/src/packages ; do
if test -d $TEST_DIR/SPECS -a -d $TEST_DIR/SOURCES -a \
-d $TEST_DIR/RPMS -a -d $TEST_DIR/SRPMS -a \
-d $TEST_DIR/BUILD ; then
RPM_SOURCESDIR=$TEST_DIR/SOURCES
fi
done
fi
if test x$RPM_SOURCESDIR = x ; then
AC_MSG_RESULT(not found)
RPM_SOURCESDIR=""
else
AC_MSG_RESULT(found)
HAVE_RPM_PACKAGING=yes
fi
fi
AC_SUBST(HAVE_RPM_PACKAGING)
# If we're running gcc, add '-Wall' to CFLAGS. # If we're running gcc, add '-Wall' to CFLAGS.
AC_MSG_CHECKING(to see if we can add '-Wall' to CFLAGS) AC_MSG_CHECKING(to see if we can add '-Wall' to CFLAGS)
@ -698,7 +667,8 @@ AC_OUTPUT(
packaging/Makefile packaging/Makefile
packaging/nsis/Makefile packaging/nsis/Makefile
packaging/rpm/Makefile packaging/rpm/Makefile
packaging/rpm/ethereal.spec packaging/rpm/SPECS/Makefile
packaging/rpm/SPECS/ethereal.spec
packaging/svr4/Makefile packaging/svr4/Makefile
packaging/svr4/checkinstall packaging/svr4/checkinstall
packaging/svr4/pkginfo packaging/svr4/pkginfo

View File

@ -1 +1,3 @@
EXTRA_DIST = ethereal.spec.in SUBDIRS = SPECS
clean-local:
rm -rf BUILD RPMS SOURCES SRPMS

View File

@ -0,0 +1 @@
EXTRA_DIST = ethereal.spec.in