OpenPKG CVS Repository
http://cvs.openpkg.org/
____________________________________________________________________________
Server: cvs.openpkg.org Name: Ralf S. Engelschall
Root: /e/openpkg/cvs Email: [EMAIL PROTECTED]
Module: openpkg-re Date: 04-Dec-2002 10:59:07
Branch: HEAD Handle: 2002120409590600
Added files:
openpkg-re packaging.txt todo.txt upgrade.txt
Log:
moved to this location from openpkg-adm
Summary:
Revision Changes Path
1.1 +176 -0 openpkg-re/packaging.txt
1.1 +239 -0 openpkg-re/todo.txt
1.1 +211 -0 openpkg-re/upgrade.txt
____________________________________________________________________________
Index: openpkg-re/packaging.txt
============================================================
$ cvs update -p -r1.1 packaging.txt
Packaging HowTo
===============
Package Classes
---------------
- based on Automake+Autoconf+Make
recognition: Makefile.am
example: recode
implicates: configure, make, CC, CFLAGS, CPPFLAGS, LDFLAGS, DESTDIR, --prefix
hint: configure --help
%build:
CC="%{l_cc}" \
CFLAGS="%{l_cflags -O}" \
./configure \
--prefix=%{l_prefix} \
...
%{l_make} %{l_mflags -O}
%install
...
%{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
...
- based on Autoconf+Make
recognition: Makefile.in
example: lmtp2nntp
implicates: configure, make, CC, CFLAGS, CPPFLAGS, LDFLAGS, --prefix
hint: configure --help, vi Makefile.in + search for "DESTDIR" or "prefix = .."
and
look for "install:", "$(MAKE) $(MFLAGS)" instead of "make"
%build:
CC="%{l_cc}" \
CFLAGS="%{l_cflags -O}" \
./configure \
--prefix=%{l_prefix} \
...
%{l_make} %{l_mflags -O}
%install
...
%{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
...
%install
...
%{l_make} %{l_mflags} install \
prefix=$RPM_BUILD_ROOT%{l_prefix} \
exec_prefix=$RPM_BUILD_ROOT%{l_prefix}
...
BuildPreReq: ..., make
%install
...
%{l_make} %{l_mflags} install \
prefix=$RPM_BUILD_ROOT%{l_prefix} \
exec_prefix=$RPM_BUILD_ROOT%{l_prefix}
...
%install
...
%{l_shtool} subst -s \
-e "s;^\\(prefix[^=]=\\).*;\\1 $RPM_BUILD_ROOT%{l_prefix};g" \
-e "s;^\\(exec_prefix[^=]=\\).*;\\1 $RPM_BUILD_ROOT%{l_prefix};g" \
`find . -type f -name Makefile -print`
%{l_make} %{l_mflags} install
...
- based on Make
recognition: Makefile
implicates: make
example: bind, postfix
hint: vi Makefile + search for "CC", "CFLAGS", "prefix=", ...
!! Do not trust vendor anymore in this class, especially for install
procedure !!
%build:
%{l_make} %{l_mflags -O}
CC="%{l_cc}" \
CFLAGS="%{l_cflags -O}"
%install
%{l_shtool} mkdir -f -p -m 755 \
$RPM_BUILD_ROOT%{l_prefix}/bin \
$RPM_BUILD_ROOT%{l_prefix}/man/man1
%{l_shtool} install -c -s -m 755 \
foo $RPM_BUILD_ROOT%{l_prefix}/bin/
%{l_shtool} install -c -m 644 \
foo.1 $RPM_BUILD_ROOT%{l_prefix}/man/man1/
- based on nothing
recognition: no Makefile at all
example: rfc, rpl
implicates: do everything manually
hint: scripts
%build
%{l_cc} %{l_cflags -O} -o bar bar.c
%install
%{l_shtool} mkdir -f -p -m 755 \
$RPM_BUILD_ROOT%{l_prefix}/bin
%{l_shtool} install -c -m 755 \
-e "s;^#!.*;#!%{l_prefix}/bin/perl;" \
foo $RPM_BUILD_ROOT%{l_prefix}/bin/
Typical Problems
----------------
- foo-1.2.tar.gz but does not unpack into foo-1.2 (uses foo):
<< %setup -q
>> %setup -q -n foo
- multiple source files (see bind):
<< %setup -q
>> %setup0 -q -c
>> %setup1 -q -T -D -a 1
>> :
>> %setupN -q -T -D -a N
- setuid/setgid or config files:
<< %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
>> %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
>> %{l_files_std} \
>> '%attr(4755,root,%{l_fsgrp}) %{l_prefix}/bin/foo' \
>> '%config %{l_prefix}/etc/foo/*'
- GNU make instead of any make
- not supported DESTDIR
- Makefile dependencies force rebuild on install after subst
gcc
- complex packaging due to many choices
apache
- info/dir in many packages
>> %install
rm -f $RPM_BUILD_ROOT%{l_prefix}/info/dir
- lib/charset.alias in many packages
>> %install
rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/charset.alias
- manual stripping of executables
recognition: file /cw/bin/* -> "not stripped"
or Makefile: install -c foo .. instead of install -c -s foo ...
>> %install
strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
- supresss setuid/setgid/sticky owner/group in install procedure
- Makefiles dislike parallel building:
<< %{l_make} %{l_mflags -O}
>> %{l_make} %{l_mflags}
- compiler dislikes optimization (segfault on C++ code):
<< CFLAGS="%{l_cflags -O}"
>> CFLAGS="%{l_cflags}"
- package requires other package "foo" (library):
<< BuildPreReq: ...
>> BuildPreReq: ..., foo
<< CC="%{l_cc}" \
<< CFLAGS="%{l_cflags -O}" \
<< ./configure \
<< ...
>> CC="%{l_cc}" \
>> CFLAGS="%{l_cflags -O}" \
>> CPPFLAGS="-I%{l_prefix}/include" \
>> LDFLAGS="-L%{l_prefix}/lib" \
>> ./configure \
>> ...
Index: openpkg-re/todo.txt
============================================================
$ cvs update -p -r1.1 todo.txt
ToDo
====
OpenPKG 1.2
-----------
TODO:
o on package upgrade %pre/%post have to make sure that running
daemons are stopped and restarted again but not if the daemon
was still not started at all.
o INN: does not correctly shutdown: rc.news and innwatch keep running
o wml 2.0.8 fails with Perl 5.8.0, 2.0.9 does not package because
of Autoconf inconsistencies
o petidomo: 4.0b1/4.0b2 problems
o cvs: hang problem and 100% CPU utilization under still unknown circumstances
o lmtp2nntp: (1) 1.2.0!!, (2) does not correctly shutdown
(3) Nov 27 13:12:58 en4.engelschall.com <info> postfix/lmtp[4093]:
C35E94CE754: to=<[EMAIL PROTECTED]>,
relay=none, delay=0, status=deferred (connect to
/e/visp/var/lmtp2nntp/lmtp2nntp.socket[/e/visp/var/lmtp2nntp/lmtp2nntp.s
ocket]: Permission denied)
o upgrade to RPM 4.1
o make OSSP l2 and OSSP cfg fully stable in order to make OSSP fsl
fully stable which in turn makes all of our OSSP fsl based packages.
CANDO:
o what about logfiles in var? Use RPM's %ghost? etc. or better %preun?
We need a more correct handling of this stuff!
rpm -e sometimes leaves files
rpm -Uvh sometimes overwrites existing logfiles
o there is %l_cppflags and %l_ldflags since recently, but they are not
used across all packages.
o includes are both under <prefix>/include and
<prefix>/include/<package>. This is inconsistent. We should move to
<prefix>/include/<package> for full consistency and less conflicts.
Unfortunately this means that CFLAGS/CPPFLAGS of applications then
require extra -I<prefix>/include/<package>/.
o switch to flex 2.5.2x in flex package and make sure all other
packages which use it (see following list) build correctly.
(a2ps aide amd apache bc bind8 c2man doxygen fetchmail flex gated
gentle glimpse graphviz htdig inn kerberos l2 libdnet libpcap
magicpoint max nmap orbit perl perl58 petidomo php portfwd
postgresql radius sharutils splint spread sysmon tetex tin treecc
txt2pdf unixodbc ups var)
o make packages aware that they must be installed as root because
they utilize special accounts or require setuid programs.
o Request For Packaging:
cdrecord dialog dlint dnswalk dog ed emil sgrep splitdigest
symlinks tmpreaper top tree ttylog wmf weblint websec wipe
xfree86 kde tripwire diablo mon analog+rmagic nlp magicpoint
bb netpbm mgv vnc+tight xmms icecast smake eperl cvs2cl
o Update gtk+ and dependencies:
We package version 1.2
Version 1.3 is stable since July 2000
Version 2.0 is stable since March 2002
Version 2.1 is current
Prerequisite packages for gtk+-2.X
atk-1.X
glib-2.X
pango-1.X
o (Optional) Shared Library Support:
run crle (SOlaris) and ldconfig (FreeBSD, Linux) on system startup
or/and set correct LD_LIBRARY_PATH on every usage...
-----------------------------------------------------------------------------
OLD STUFF:
- prereq script (-> cschug)
- new packages: scribus, ngrep
- sendmail
- kdexxxx (3.0)
- koffice
- OpenPKG Style Guide!
- admin: openpkg bugdb config zerschossen
- put unzip into bootstrap for consistency and to simplify docbook, etc.
- for OpenPKG 1.2:
- ~/.openpkg/rc.conf overrides rc.conf plus --norc option
- use more l_xusr/l_xgrp for x = r and x = n
- l_mgrp problem reported by ps
- general openpkg_enable for rc
- /cw/local/etc/rc.d/ supporten inclusive mergen aufgrund prios mit
/cw/etc/rc.d
- consistently use X11 package
- rc verbose messages
- rc %status (especially internally for %start/%stop)
- OpenPKG: add support to rpm for patch -d, i.e., passing through -d
option
* admin: contributor page & area
- admin: openpkg+ossp mailing lists auf :include: umstellen und MMX
nutzen!
- admin: automatical -CURRENT source building
- admin: package browser: alpha, by-group, top-sort
- new bug database (public=roadmap & private parts)
- dev: OpenPKG: rpmtool config ueberall nutzen!
- doc: brochure
- doc: still a couple of FIXMEs in handbook
o rc.pod & local rc.d support
o _enable + if code oder ()
o fetch command for --fetch
o group: license: checken auf korrektheit
o with_xxx=xxx nicht ueberall im %description
o PATH="%{l_prefix}/bin:$PATH"; export PATH kann entfernt werden!!
o description cleanups
o INN still does not startup for news.openpkg.org
o the RDF indexing is still incomplete
o the website is still broken because of the repository and RDF stuff
o the website should be automatically updated by cron
o shiela works, but should really _USE_ its Environment stuff!!
- emirror
- zope
- mailman
- checkbot
o monit und/oder daemontools oder %status im Bootstrap
o rpm --rebuild http://foo.src.rpm http://bar.src.rpm http://bla.src.rpm
bleibt i.d.R. nach dem build von foo haengen bzw. er hat wohl Probleme,
bar zu saugen. Es erfolgt auch kein timeout.
o rpm braucht wohl --user/--group?
o rpm braucht immer noch root-perms?
o perl wuerde gerne pod2man waehrend build finden
o external third-party depencencies
o rpmupdate script:
manuell alles ausserhlab von /cw updaten auf aktuellen Stand.
Vorallem: shell des cw users
o OpenSSH braucht moeglichkeit, nur bestimmte Hosts zuzulassen,
eventuell nur ueber libwrap moeglichkeit
o Tru64 GCC etc.
o rpmx.pl: rpm -Uvhs openssh -> ...
- root wird fuer install benoetigt
o Config-Files im CVS:
- RPM bootstrap beinhaltet CVS und ein leeres CVS repository
- packerl beinhaltet default config + %post wo %config files
sofort in CVS importiert werden.
- naechtlicher Check, ob ausgecheckte Version mit Repository
Version uebereinstimmt -> cvs diff mail
o %package Feature nutzen
-com
/ \
v v
-sys -usr
^ ^
\ /
-dev
-sys ../sbin/* ../man/man8/* (../etc/*)
-usr ../bin/* ../man/man1/*
-com ../lib/*.so (../etc/*)
-dev ../lib/*.a ../man/man3/* ../include/* (.la)
potentielle Kandidaten sys/usr:
- bind
- dhcpd
- rsync
- mysql
- snmp
- cvs (rc.cvsd)
- inn
- ntp
- openssh
- openldap
- samba
- sendmail
potentielle Kandidaten com/dev:
- jpeg
- png
- glib
- gtk
- libiconv
- libpcap
- ncurses
- openssl (usr,dev)
- pth
- qt
- sasl
- sfio
- skey
- slang
- zlib
o /cw/RPM/TMP/ expiren damit permission probleme nicht auftreten zwischen
privilegierten Usern und nicht-privilierten waehrend build-time
-> tmpreaper
o lsof hat noch kein Target fuer Tru64 bzw. Digital Unix im spec file
o OpenLDAP unter Solaris hat falsche Pfade drin, weil
bei "make install" erneut adjustiert wird
o Samba: problem ist auch, dasz man alle(!) nmbd Prozesse abschiessen muss
damit keine Leichen rumliegen
o Doku:
o root user hat /cw/bin:/cw/sbin _HINTEN_ im $PATH wg. conflicts with vendor
package system, z.B. install-info des Debian-Packet-Managers in conflict
with OpenPKG Texinfo
andere user hat /cw/bin:/cw/sbin _VORNE im $PATH
o Locales machen massiv probleme: warning wenn nicht LC_ALL=C
o Platform Requirements:
Solaris:
- SUNWski oder ANDIrand
- /usr/ccs/bin
Debian GNU/Linux:
- libpam0g-dev
- ncompress
- sharutils
- gettext
FreeBSD:
- base installation
o Web: pkg.cgi:
flat-list, nur source oder nur binary einer Platform
optisch wie derzeit auf 2. Ebene
o pkg.mkdb oder pkg.cgi schneidet Paketnamen beim ersten "-" bereits ab:
sh-utils" -> "sh"
o OpenPKG-server, OpenPKG-desktop, OpenPKG-cw, OpenPKG-misc distributions
machen
o rpm:
- gettext dabeihaben bei build fuer msgfmt, etc.
- rpmathome
- --define 'nosmp 1' => kein -j4, etc.
- rpm -qi verbessern wegen langen URLs, etc.
o qpopper: pop-before-smtp
o petidomo: ala Debian: MTA provides script for aliases API
o repository: sortierung nach mehreren Kriterien:
- group + alphabetisch in group
- alphabetisch
- mtime
- 1 und 2 Ebene zusammenfassung
Index: openpkg-re/upgrade.txt
============================================================
$ cvs update -p -r1.1 upgrade.txt
General Note
============
You cannot skip a version. That means, upgrading from 0.9 to 1.1
requires an upgrade to 1.0 as an intermediate step.
Upgrade inside OpenPKG-CURRENT
==============================
o coreutils
GNU merged their fileutils, shellutils and textutils projects into
the new coreutils. Hence the three OpenPKG packages fileutils,
shellutils and textutils were removed from OpenPKG-CURRENT and a new
coreutils package was created which replaces the three obsoleted
ones now.
Upgrade from OpenPKG 1.0 to OpenPKG 1.1
=======================================
o libiconv
When upgrading the "libiconv" package you first have to deinstall
("rpm -e libiconv") the old version before building ("rpm
--rebuild") and installing ("rpm -Uvh") the new version. This is due
to the fact that libiconv would see the old version's include files
and hence break to build.
o Berkeley-DB and OpenLDAP
The "db" package is now Berkeley-DB 4.0 while the Berkeley-DB 3.3
is now named "db3". When upgrading "openldap" (or similar packages
which require "db") you first have to upgrade the "db" package,
too. If other packages (like "inn") require DB 3 you also have to
additionally install "db3".
o Additional user accounts
OpenPKG 1.1 adds additional user accounts to the system. The new UIDs
are not used by the bootstrap itself and can be changed by manually
configuring the system files immediately after the upgrade. Do not
modify them after any dependent packages were installed (i.e. postfix
and sendmail) as these packages might compile UIDs into the binary.
o Removed Packages
OpenPKG 1.1 does not include autogen, guile, imapd and sfio. They
have been put into EVAL or JUNK classes and are only available as
CURRENT packages which can be downloaded as source RPMs from
ftp://ftp.openpkg.org/CURRENT/SRC/.
o Inconsistent rc.conf variables in rsync
Previously the rsync package inconsistently used rc.conf variables
with prefix "rsyncd_". This was now corrected to be "rsync_". The
entries in rc.conf have to be corrected manually.
o BIND8 vs BIND9
In OpenPKG 1.1 the "bind" package is based on BIND9 where OpenPKG
1.0 used BIND8. The old package was renamed to "bind8" to support
installations which depend on BIND8. Because the package name
changed, RPM treats it as two different packages. The configuration
of the old package must be backed up manually, then the old package
needs to be removed. Finally the new "bind8" package must be
installed and configuration recovered manually.
o PAM
In OpenPKG 1.0 some daemon packages by default had PAM support
enabled. Unfortunately PAM makes trouble in a cross-platform
approach, hence OpenPKG 1.1 has PAM support disabled in all packages
by default. Instead PAM support can be consistently enabled there
through a --define "with_pam yes" during build-time. This now
requires the "pam" glue package to be installed first. This "pam"
package now takes over the task of reconfiguring the /etc/pam.d/ or
/etc/pam.conf in a consistent way. The following table compares
PAM support between this and the previous OpenPKG release.
OpenPKG 1.0 OpenPKG 1.1 PAM support in OpenPKG 1.1
--------------------------------------------------------------------
apache apache %with_mod_auth_pam
imapd n/a package removed
openldap openldap no PAM support
openssh openssh %with_pam
proftpd proftpd %with_pam
pureftpd pureftpd %with_pam
qpopper qpopper %with_pam
samba samba %with_pam
n/a sasl %with_pam; new package
sudo sudo %with_pam
o Bootstrapping and C Compiler
For machines which do not have any C compiler at all (Solaris!), you
usually have to install a gcc via binary somewhere. If it is outside
the OpenPKG hierarchy, the sane build environment prevents OpenPKG
from finding and using it. To tell OpenPKG about this "cc" you have to
add an ~/.rpmmacros with "%with_cc /path/to/this/bootstrap/cc".
o Shared Libraries
OpenPKG still has the policy of not using shared libraries for
cross-platform reasons. Nevertheless by accident some OpenPKG 1.0
packages (e.g. "mysql") included shared library versions. If you
had installed packages (e.g. "apache+mod_php") which linked against
the MySQL shared libraries, those packages are broken until also
upgraded and rebuilt. To avoid such temporary brokeness, this means
you should make sure that an all packages at once are upgraded from
OpenPKG 1.0 to 1.1 if possible.
Upgrade from OpenPKG-CURRENT to OpenPKG 1.1
===========================================
o RPM downgrade view:
Please understand the difference between a real up-/downgrade compared
to what RPM thinks is a up-/downgrade.
The nature of the OpenPKG release engineering version number scheme
unconditionally makes RPM think that the step from CURRENT to any
release is a downgrade. Use --oldpackage along with -Uvh to cheat and
force RPM to accept that "downgrade". Some packages might require an
additional --nodeps to unchain version dependencies for the same
reason. An alternative to ignoring depencencies is to specify all
dependent packages on a single command line.
o binutils/gcc/openpkg:
If binutils and gcc-3.2 were installed previously, binutils, gcc and
openpkg must be upgraded in exacly that order.
Due to a problem with binutils before 200208261229 FreeBSD users will
receive static ELF binaries with the wrong brand. The loader will reject
them with error 'ELF binary type "0" not known'. Unfortunately, the
/cw/lib/openpkg/rpm executable called by the /cw/bin/rpm wrapper is
such a binary. If you receive this error the last chance to recover is
to brand the binary manually, i.e. using
$ brandelf -t "FreeBSD" /cw/lib/openpkg/rpm
The following table shows the three critical packages and tells which
are identical besides the number. If CURRENT packages are older than
those listed, switching to v1.1.0 is a real upgrade. If the numbers
match exactly switching to v1.1.0 will not change anything but the
number. If CURRENT packages are newer than those listed, switching to
v1.1.0 is a real downgrade.
openpkg-20020826-20020826 = openpkg-1.1.0-1.1.0
binutils-2.13-20020826 = binutils-2.13-1.1.0
gcc-3.2-20020815 = gcc-3.2-1.1.0
Upgrade from OpenPKG 0.9 to OpenPKG 1.0
=======================================
No known issues.
Upgrade from rpm-4.0-N to OpenPKG 0.9
=====================================
o Upgrading Bootstrap Package:
Until July 2001 the OpenPKG (http://www.openpkg.org/) bootstrap
package was named "rpm-4.0-N". Because over the time it mutated into
something which is actually a lot more than just RPM, it was renamed
to "openpkg-0.9-N" recently. For safe upgrading in the future, it is
_VERY_ important that all already existing OpenPKG installations are
_NOW_ upgraded to the new bootstrap package.
For the experts: it has to be done before we rename/add/delete files
in forthcoming openpkg-0.9-X versions, because otherwise a complete
reinstall would be required later or the database would no longer be
in sync with the installed files if you upgrade too late.
To determine whether an OpenPKG hierarchy has to be upgraded, run the
following command:
# 0. determine current state
$ rpm -qa | egrep '(rpm|openpkg)'
If the output is "rpm-4.0-X" upgrading is required. If the output is
"openpkg-0.9-X" upgrading was already done (perhaps by someone else)
and so you do _NOT_ have to upgrade immediately.
If upgrading is required, enter as soon as possible the following
commands as "root" exactly as they are written down here and in
exactly this order for every OpenPKG filesystem hierarchy (replace /cw
with the path to your particular OpenPKG hierarchy):
# 1. enter the OpenPKG filesystem hierarchy (for relative paths below)
$ cd /cw
# 2. rebuild the OpenPKG bootstrap package for this hierarchy
$ bin/rpm --rebuild http://www.openpkg.org/pkg/openpkg-0.9-8.src.rpm
# 3. remove the old bootstrap name from RPM database
$ bin/rpm -e --justdb --nodeps rpm
# 4. install the new bootstrap [expect 2 warnings]
$ bin/rpm -i --noscripts --nodeps --force RPM/PKG/openpkg-0.9-8.*.rpm
# 5. rebuild the RPM database
$ bin/rpm --rebuilddb
# 6. cleanup after upgrade
$ rm -f etc/rpm/*.rpmorig
For more details or help in case of problems, feel free to contact Ralf.
______________________________________________________________________
The OpenPKG Project www.openpkg.org
CVS Repository Commit List [EMAIL PROTECTED]