--- /dev/null
+# Default configuration file for debian packages
+
+Include("default.cfg");
+
+UnSet("CONFIG_LOCAL");
+Set("CONFIG_INSTALL_API");
+
+Set("CONFIG_DOC");
+Set("CONFIG_CHARSET");
+Set("CONFIG_XML");
+Set("CONFIG_IMAGES");
+
+1;
--- /dev/null
+Source: libucw
+Section: apps
+Priority: optional
+Maintainer: Pavel Charvat <pchar@ucw.cz>
+Build-Depends: debhelper (>= 7)
+Standards-Version: 3.8.0
+
+Package: libucw-@UCW_ABI_VERSION@
+Architecture: any
+Depends: ${shlib:Depends}, ${misc:Depends}
+Description: LibUCW library
+
+Package: libucw-dev
+Architecture: any
+Depends: libucw-@UCW_ABI_VERSION@ (= @VER@), ${shlib:Depends}, ${misc:Depends}
+Description: LibUCW development files
+
+Package: libucw-doc
+Architecture: all
+Depends: ${shlib:Depends}, ${misc:Depeneds}
+Description: LibUCW documentation
--- /dev/null
+This is the UCW library, which aims to provide a set general purpose tools
+for programming in the C language.
+
+It can be freely distributed and used according to the terms of
+the GNU Lesser General Public License, either version 2 or any later
+version. Several modules are in public domain.
--- /dev/null
+#!/bin/bash
+# A script for building of LibUCW packages
+# (c) 2013 Pavel Charvat <pchar@ucw.cz>
+
+set -e
+. debian/pkg-lib
+
+function usage {
+ cat >&2 <<EOF
+Usage: $0 <options>
+Options:
+--archonly Build only binary packages
+--cleanup Cleanup temporary files when finished
+--version=<ver> Custom version number of resulting packages (default: autodetect from git-describe)
+EOF
+ exit 1
+}
+
+function pkg-gen-debian {(
+ cd $BUILDDIR
+ echo "Configuring"
+ ./configure debian/config VER="$VER" TREEHASH="$TREEHASH" $CONF PREFIX=/ INSTALL_INCLUDE_DIR=/usr/include/libucw
+
+ echo "Creating debian/control"
+ build/genconf debian/control.in debian/control obj/config.mk
+
+ echo "Creating debian/changelog"
+ export EDITOR=true
+ CL=debian/changelog
+ rm -f $CL
+ dch --changelog=$CL --create --package=$PKG --newversion=$VER "Automatic release."
+ dch --changelog=$CL --release
+ sed -i '/Initial release/d' $CL
+)}
+
+ROOT="`pwd`"
+PKG=libucw
+ARCHONLY=
+CLEANUP=
+CONF=
+while [ -n "$1" ] ; do
+ case "$1" in
+ --archonly) ARCHONLY=1
+ ;;
+ --cleanup) CLEANUP=1
+ ;;
+ --version=*) PKGVER="${1:10}"
+ ;;
+ *) usage
+ ;;
+ esac
+ shift
+done
+
+pkg-git-version
+pkg-git-checkout
+
+echo $TREEVER >$BUILDDIR/UCW_VERSION
+pkg-gen-debian
+(cd $BUILDDIR && dpkg-buildpackage -rfakeroot -us -uc ${ARCHONLY:+"-B"})
+[ -z "$ARCHONLY" ] || rm -f debian-tmp/*_all.deb
+pkg-get-files debian-tmp/*.{deb,dsc,changes}
+
+[ -z "$CLEANUP" ] || pkg-cleanup
--- /dev/null
+# A library of shell functions for building of Debian packages
+# (c) 2008--2009 Martin Mares <mj@ucw.cz>
+# (c) 2009--2013 Pavel Charvat <pchar@ucw.cz>
+
+# Expects:
+# PKG name of the package
+# ROOT absolute path to the root of the source tree
+# PKGVER custom package version
+
+unset PKG ROOT SRCVER VER
+
+function pkg-git-version {
+ TREEVER=`git describe | sed 's/^v//;s/[a-f]$/&-0/'`
+ TREEHASH=`git rev-parse --verify HEAD`
+ VER=${PKGVER:-$TREEVER}
+ SRCVER=${PKGVER:-$VER}
+ cat <<EOF
+###
+### Source tree version: $TREEVER
+### Source tree hash: $TREEHASH
+### Debian binary package version: $VER
+### Debian source package version: $SRCVER
+###
+### Hey, did you commit everything? Or added it to the index?
+###
+
+EOF
+}
+
+function pkg-git-checkout {
+ BUILDDIR=debian-tmp/$PKG-$SRCVER
+ rm -rf debian-tmp
+ mkdir -p $BUILDDIR
+ git checkout-index -a --prefix=$BUILDDIR/
+}
+
+function pkg-fake-changelog {
+ echo "Creating automatic changelogs for package $PKG version $VER"
+ (
+ export EDITOR=true
+ CL=debian/changelog
+ rm -f $CL
+ dch --changelog $CL --create --package $PKG --newversion $VER "Automatic release. See /usr/share/doc/$PKG/changelog for the true story."
+ dch --changelog $CL --release
+ sed -i '/Initial release/d' $CL
+ )
+}
+
+function pkg-cleanup {
+ echo -n "Press return to delete temp files... "
+ read YES
+ rm -rf $ROOT/debian-tmp
+}
+
+function pkg-get-files {
+ echo
+ echo "Generated files:"
+ FILES=
+ unset FILES_ARY[@]
+ for F in "$@" ; do
+ if [ -f "$F" ] ; then
+ FILES="$FILES${FILES:+,}$F"
+ FILES_ARY[${#FILES_ARY[@]}]="$F"
+ echo "$F"
+ fi
+ done
+ if [ -z "$FILES" ] ; then
+ echo "No files found"
+ return 1
+ fi
+}
--- /dev/null
+#!/usr/bin/make -f
+# debian/rules for LibUCW
+# (c) 2013 Pavel Charvat <pchar@ucw.cz>
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+include obj/config.mk
+
+build: build-stamp
+
+build-stamp:
+ dh_testdir
+ $(MAKE)
+ #$(MAKE) tests
+ touch $@
+
+clean:
+ dh_testdir
+ dh_testroot
+ rm -f build-stamp
+ -$(MAKE) clean
+ dh_clean
+
+install: build
+ dh_testdir
+ dh_testroot
+ dh_clean -k
+ dh_installdirs
+ $(MAKE) DESTDIR=$(CURDIR)/debian/libucw-$(UCW_ABI_VERSION) $(addprefix install-,libucw libucw-charset libucw-xml libucw-images)
+ $(MAKE) DESTDIR=$(CURDIR)/debian/libucw-dev $(addprefix install-,$(addsuffix -api,libucw libucw-charset libucw-xml libucw-images))
+ $(MAKE) DESTDIR=$(CURDIR)/debian/libucw-doc install-libucw-docs
+
+binary-indep: build install
+
+binary-arch: build install
+ dh_testdir
+ dh_testroot
+ dh_installchangelogs
+ dh_installdocs
+# dh_installexamples
+# dh_install
+# dh_installmenu
+# dh_installdebconf
+# dh_installlogrotate
+# dh_installemacsen
+# dh_installpam
+# dh_installmime
+# dh_installcron
+# dh_installinfo
+# dh_installman
+# dh_link
+# dh_strip
+ dh_compress
+ dh_fixperms
+# dh_perl
+# dh_python
+ dh_makeshlibs
+ dh_installdeb
+ dh_shlibdeps
+ dh_gencontrol
+ dh_md5sums
+ dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install