Check-in [8757ba0280]
Overview
Comment:Updated to create Debian package from RPM version
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 8757ba0280d9f583291a933367ec5da24caeb5b9
User & Date: rkeene on 2010-06-05 23:46:42
Other Links: manifest | tags
Context
2010-06-07
04:41
Added LICENSE and README

Renamed aclocal PCSC script

Added warnings for PC/SC libraries and headers not being found check-in: 6e6d64508e user: rkeene tags: trunk

2010-06-05
23:46
Updated to create Debian package from RPM version check-in: 8757ba0280 user: rkeene tags: trunk
20:18
CACKey 0.5.11 check-in: 1a514f86a4 user: rkeene tags: 0.5.11, trunk
Changes

Modified build/make-release from [0254258e24] to [37e5d36a75].

23
24
25
26
27
28
29




30
31
32
33
34
35
36
mkdir -p ~/rpmbuild/SPECS ~/rpmbuild/SOURCES

cp "${CACKEY_TARBALL}" ~/rpmbuild/SOURCES/ || exit 1
tar -xOf "${CACKEY_TARBALL}" cackey-${VERSION}/cackey.spec > ~/rpmbuild/SPECS/cackey-${VERSION}.spec || exit 1

rpmbuild -ba ~/rpmbuild/SPECS/cackey-${VERSION}.spec || exit 1





## Create Slackware package
mkdir -p ~/rpmbuild/TGZ

WORKDIR="${TMPDIR:-/tmp}/cackey-build-$$${RANDOM}${RANDOM}${RANDOM}"
WORKDIRINSTROOT="${WORKDIR}/root"
export WORKDIR WORKDIRINSTROOT








>
>
>
>







23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
mkdir -p ~/rpmbuild/SPECS ~/rpmbuild/SOURCES

cp "${CACKEY_TARBALL}" ~/rpmbuild/SOURCES/ || exit 1
tar -xOf "${CACKEY_TARBALL}" cackey-${VERSION}/cackey.spec > ~/rpmbuild/SPECS/cackey-${VERSION}.spec || exit 1

rpmbuild -ba ~/rpmbuild/SPECS/cackey-${VERSION}.spec || exit 1

# Create Debian package from RPM
mkdir -p ~/rpmbuild/DEB
"$(dirname "$0")/rpm2deb" ~/rpmbuild/RPMS/i386/cackey-${VERSION}-1.i386.rpm ~/rpmbuild/DEB/cackey_${VERSION}-1_i386.deb

## Create Slackware package
mkdir -p ~/rpmbuild/TGZ

WORKDIR="${TMPDIR:-/tmp}/cackey-build-$$${RANDOM}${RANDOM}${RANDOM}"
WORKDIRINSTROOT="${WORKDIR}/root"
export WORKDIR WORKDIRINSTROOT

Added build/rpm2deb version [7cc46ae9f0].























































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#! /bin/bash

RPMFILE="$(readlink -f "$1")"
DEBFILE="$2"
export RPMFILE DEBGFILE

if [ -z "${RPMFILE}" ]; then
	echo 'Usage: rpm2deb <rpmfile> [<debfile>]' >&2

	exit 1
fi

if [ -z "${DEBFILE}" ]; then
	DEBFILE="$(echo "${RPMFILE}" | sed 's@\.rpm$@.deb@')"

	if [ "${DEBFILE}" = "${RPMFILE}" ]; then
		DEBFILE="${RPMFILE}.deb"
	fi
fi

WORKDIR="${TMPDIR:-/tmp}/rpm2deb-$$${RANDOM}${RANDOM}${RANDOM}"
TMPCPIOFILE="${WORKDIR}/tmp.cpio"
export WORKDIR TMPCPIOFILE

mkdir -p "${WORKDIR}" "${WORKDIR}/deb" "${WORKDIR}/control" "${WORKDIR}/root" || exit 1
chmod 700 "${WORKDIR}"

rpm2cpio < "${RPMFILE}" > "${TMPCPIOFILE}"

# Extract files
(
	cd "${WORKDIR}/root" || exit 1

	cpio -i --no-absolute-filenames --quiet --make-directories < "${TMPCPIOFILE}"
) || exit 1

# Create control files
(
	cd "${WORKDIR}/root" || exit 1

	## Create MD5 Sums
	find . -type f | xargs md5sum > "${WORKDIR}/control/md5sums"

	## Create Package description
	rpm -q --queryformat 'Package: %{Name}\nVersion: %{Version}-%{Release}\nArchitecture: %{Arch}\nInstalled-Size: %{Size}\nMaintainer: %{Packager}\nDescription:' -p "${RPMFILE}" > "${WORKDIR}/control/control"
	rpm -q --queryformat '%{Description}' -p "${RPMFILE}" | sed 's@^@ @;s@^ $@ .@' >> "${WORKDIR}/control/control"
echo '' >> "${WORKDIR}/control/control"

	## Create tarball with all data
	cd "${WORKDIR}/control" || exit 1
	tar -zcf "${WORKDIR}/deb/control.tar.gz" *
) || exit 1

# Create debian-binary
echo '2.0' > "${WORKDIR}/deb/debian-binary"

# Create Data archive
(
	cd "${WORKDIR}/root" || exit 1

	cpio -i --list --quiet < "${TMPCPIOFILE}" > "${WORKDIR}/rpm-filelist"

	tar --files-from "${WORKDIR}/rpm-filelist" -cf - | tardy -User root -Group root | gzip -9c > "${WORKDIR}/deb/data.tar.gz" 
) || exit 1

# Create Debian package
(
	cd "${WORKDIR}/deb" || exit 1

	ar rcu "${WORKDIR}/tmp.deb" debian-binary control.tar.gz data.tar.gz
)

cp "${WORKDIR}/tmp.deb" "${DEBFILE}"

rm -rf "${WORKDIR}"