[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Packaging php app/scripts



# find
.
./src
./src/index.php
./debian
./debian/control
./debian/rules
./debian/changelog
./debian/my-pkg.install
./debian/compat
./debian/copyright



# find -type f -exec echo '=== {} ===' \; -exec cat {} \; -exec echo '-----------------------' \;
=== ./src/index.php ===
-----------------------
=== ./debian/control ===
Source: my-pkg-src
Section: math
Priority: optional
Maintainer: Igor Pashev <pashev.igor@gmail.com>
Build-Depends:
 debhelper ( >= 8 ),
Standards-Version: 3.9.2

Package: my-pkg
Architecture: all
Depends: ${misc:Depends},
Description: package

-----------------------
=== ./debian/rules ===
#!/usr/bin/make -f

%:
dh $@

-----------------------
=== ./debian/changelog ===
my-pkg-src (1.2.3-4) UNRELEASED; urgency=low

  * Initial release. (Closes: #XXXXXX)

 -- Igor Pashev <pashev.igor@gmail.com>  Tue, 06 Sep 2011 22:02:10 +0400
-----------------------
=== ./debian/my-pkg.install ===
src/index.php usr/share/binary/
-----------------------
=== ./debian/compat ===
8
-----------------------
=== ./debian/copyright ===
-----------------------



# fakeroot ./debian/rules binary
dh binary
   dh_testdir
   dh_auto_configure
   dh_auto_build
   dh_auto_test
   dh_testroot
   dh_prep
rm -f debian/my-pkg.substvars
rm -f debian/my-pkg.*.debhelper
rm -rf debian/my-pkg/
   dh_installdirs
install -d debian/my-pkg
   dh_auto_install
   dh_install
install -d debian/my-pkg/usr/share/binary/
cp -a ./src/index.php debian/my-pkg/usr/share/binary//
   dh_installdocs
install -g 0 -o 0 -d debian/my-pkg/usr/share/doc/my-pkg
install -g 0 -o 0 -m 644 -p debian/copyright debian/my-pkg/usr/share/doc/my-pkg/copyright
   dh_installchangelogs
install -o 0 -g 0 -p -m644 debian/changelog debian/my-pkg/usr/share/doc/my-pkg/changelog.Debian
   dh_installexamples
   dh_installman
   dh_installcatalogs
   dh_installcron
   dh_installdebconf
install -o 0 -g 0 -d debian/my-pkg/DEBIAN
   dh_installemacsen
   dh_installifupdown
   dh_installinfo
   dh_pysupport
dh_pysupport: This program is deprecated, you should use dh_python2 instead. Migration guide: http://deb.li/dhs2p
/usr/share/python-support/private/movemodules debian/my-pkg
   dh_installinit
   dh_installmenu
   dh_installmime
   dh_installmodules
   dh_installlogcheck
   dh_installlogrotate
   dh_installpam
   dh_installppp
   dh_installudev
   dh_installwm
   dh_installxfonts
   dh_installgsettings
   dh_bugfiles
   dh_ucf
   dh_lintian
   dh_gconf
   dh_icons
   dh_perl
   dh_usrlocal
   dh_link
   dh_compress
cd debian/my-pkg
chmod a-x usr/share/doc/my-pkg/changelog.Debian
gzip -9nf usr/share/doc/my-pkg/changelog.Debian
cd '/home/pashev/tmp/test'
   dh_fixperms
find debian/my-pkg  -print0 2>/dev/null | xargs -0r chown --no-dereference 0:0
find debian/my-pkg ! -type l  -print0 2>/dev/null | xargs -0r chmod go=rX,u+rw,a-s
find debian/my-pkg/usr/share/doc -type f  ! -regex 'debian/my-pkg/usr/share/doc/[^/]*/examples/.*' -print0 2>/dev/null | xargs -0r chmod 644
find debian/my-pkg/usr/share/doc -type d  -print0 2>/dev/null | xargs -0r chmod 755
find debian/my-pkg/usr/share/man debian/my-pkg/usr/man/ debian/my-pkg/usr/X11*/man/ -type f  -print0 2>/dev/null | xargs -0r chmod 644
find debian/my-pkg -perm -5 -type f \( -name '*.so.*' -or -name '*.so' -or -name '*.la' -or -name '*.a' \)  -print0 2>/dev/null | xargs -0r chmod 644
find debian/my-pkg/usr/include -type f  -print0 2>/dev/null | xargs -0r chmod 644
find debian/my-pkg/usr/share/applications -type f  -print0 2>/dev/null | xargs -0r chmod 644
find debian/my-pkg -perm -5 -type f \( -name '*.cmxs' \)  -print0 2>/dev/null | xargs -0r chmod 644
find debian/my-pkg/usr/lib/perl5 debian/my-pkg/usr/share/perl5 -type f -perm -5 -name '*.pm'  -print0 2>/dev/null | xargs -0r chmod a-X
   dh_strip
   dh_makeshlibs
rm -f debian/my-pkg/DEBIAN/shlibs
   dh_shlibdeps
   dh_installdeb
   dh_gencontrol
echo misc:Depends= >> debian/my-pkg.substvars
dpkg-gencontrol -ldebian/changelog -Tdebian/my-pkg.substvars -Pdebian/my-pkg
chmod 644 debian/my-pkg/DEBIAN/control
chown 0:0 debian/my-pkg/DEBIAN/control
   dh_md5sums
(cd debian/my-pkg >/dev/null ; find . -type f  ! -regex '.*/DEBIAN/.*' -printf '%P\0' | LC_ALL=C sort -z | xargs -r0 md5sum > DEBIAN/md5sums) >/dev/null
chmod 644 debian/my-pkg/DEBIAN/md5sums
chown 0:0 debian/my-pkg/DEBIAN/md5sums
   dh_builddeb
dpkg-deb --build debian/my-pkg ..
dpkg-deb: сборка пакета «my-pkg» в файл «../my-pkg_1.2.3-4_all.deb».

# dpkg -c ../my-pkg_1.2.3-4_all.deb
drwxr-xr-x root/root         0 2011-09-06 22:11 ./
drwxr-xr-x root/root         0 2011-09-06 22:11 ./usr/
drwxr-xr-x root/root         0 2011-09-06 22:11 ./usr/share/
drwxr-xr-x root/root         0 2011-09-06 22:11 ./usr/share/doc/
drwxr-xr-x root/root         0 2011-09-06 22:11 ./usr/share/doc/my-pkg/
-rw-r--r-- root/root         0 2011-09-06 21:58 ./usr/share/doc/my-pkg/copyright
-rw-r--r-- root/root       162 2011-09-06 22:06 ./usr/share/doc/my-pkg/changelog.Debian.gz
drwxr-xr-x root/root         0 2011-09-06 22:11 ./usr/share/binary/
-rw-r--r-- root/root         0 2011-09-06 21:58 ./usr/share/binary/index.php


Reply to: