[Asterisk-Dev] zaptel rpm submission

Carey Jung carey at itfreedom.com
Sun Apr 6 08:31:22 MST 2003


Hi,

I hate deploying anything on a RedHat machine that isn't part of an RPM, so
I've started working on Asterisk-related RPMs.  So far I've modified the
zaptel build environment (mostly zaptel/Makefile) in to build a zaptel RPM,
and I'd like to submit my changes for review and inclusion into CVS.

Objectives:
- Add an 'rpm' target to zaptel/Makefile to build a Redhat RPM.
- Modify the zaptel build so that the RPM and a normal 'install' can be
built with the same code, and, where appropriate, as a non-root user.

Summary of Changes:
- Broke up the 'install' target into two pieces, 'install-files' and
'post-install', corresponding to the RPM '%install' and '%post' sections.
All of the 'mknode' calls, modules.conf munging, ldconfig calls, and
chkconfig calls, etc. -- which require root access -- are done by
'post-install'.  Moreover, since the build environment is not available at
%post execution time, I had to move all of the 'post-install' stuff into a
'ztpost' script, which gets installed as part of the RPM.
- Defined RPMVERSION and RPMRELEASE variables in the Makefile
- Added -DCONFIG_ZAPATA_NET to KFLAGS automatically, based on a test for
hdlc.h in the kernel source tree.  (Note: see Questions below)
- Build sethdlc automatically, using same test above.
- Added $(SETHDLC) to 'all' target
- Added 'ztpost' target to build ztpost script from ztpost.in template file.
Moved all of the device construction and other post-installation code into
this script.
- Added 'zaptel.spec' target to build zaptel.spec from zaptel.spec.in
template
- Added 'rpm' target to build zaptel RPM.  This requires no root access, so
long as your rpm build and source trees are accessible. (Usually by defining
%_topdir and %buildroot in ~/.rpmmacros.) (I was just thinking, though, that
it shouldn't be too difficult at all to do the entire build in a tmp
directory.)

Questions:
- In my particular situation, I needed to build with
KFLAGS+=-DCONFIG_ZAPATA_NET and also build 'sethdlc' to get hdlc support.  I
noticed zaptel builds fine with this defined, even w/no hdlc support in the
kernel.  So, is it safe to leave it defined all the time?  If not, what's a
good test for automatically defining it if hdlc is enabled in the kernel?
My test for automatically defining CONFIG_ZAPATA_NET or not currently fails.

I have successfully installed and tested the RPM, but only on an
hdlc-enabled machine. I've attached a tarball of my Makefile,
zaptel.spec.in, and ztpost.in.  I'd appreciate any help on the above and any
suggestions for improvement.

Regards,
Carey Jung
-------------- next part --------------
A non-text attachment was scrubbed...
Name: zaptel-mods.tar
Type: application/x-tar
Size: 20480 bytes
Desc: not available
Url : http://lists.digium.com/pipermail/asterisk-dev/attachments/20030406/37a0d963/zaptel-mods.tar


More information about the asterisk-dev mailing list