File: repack

package info (click to toggle)
gap-float 0.6.3%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 612 kB
  • ctags: 593
  • sloc: ansic: 2,568; cpp: 2,013; xml: 177; makefile: 119; sh: 100
file content (141 lines) | stat: -rwxr-xr-x 4,259 bytes parent folder | download
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
#!/bin/bash

PACKAGE_NAME=gap-float

set -e
set -u

usage() {
	echo "Usage: repack --upstream-version <ver> <downloaded file>"
	exit 1
	}

if [ "$#" != "3" ]; then
	usage
fi
if [ "$1" != "--upstream-version" ]; then
	usage
fi
if [ ! -f "$3" ]; then
	if [ -n "$3" ]; then
		echo "$3 doesn't exist"
	fi
	usage
fi
UPSTREAM_VERSION="$2"
UPSTREAM_TARBALLZZ="$3"

DEBIAN_SUFFIX="+ds"
####DEBIAN_ENCAPSULATEDFOLDERNAME="${PACKAGE_NAME}-usrc"

DEBIAN_UVERSION=${UPSTREAM_VERSION}${DEBIAN_SUFFIX}
DEBIAN_ROOTFOLDERNAME="${PACKAGE_NAME}-${DEBIAN_UVERSION}.orig"
DEBIAN_TARBALLXZ="$(dirname $UPSTREAM_TARBALLZZ)/${PACKAGE_NAME}_${DEBIAN_UVERSION}.orig.tar.xz"

REPACK_TMPDIR=`mktemp -d ./repackXXXXXX`
REPACK_TMPDIR=$(readlink -f "$REPACK_TMPDIR")
trap "/bin/rm -rf \"$REPACK_TMPDIR\"" QUIT INT EXIT

message() {
	echo
	echo "-- -- $1"
	echo
	}

message "Repackaging $UPSTREAM_TARBALLZZ"

UPSTREAM_ROOTFOLDER="${REPACK_TMPDIR}/unpacked"
mkdir "${UPSTREAM_ROOTFOLDER}"
tar -C "${UPSTREAM_ROOTFOLDER}" -xf "${UPSTREAM_TARBALLZZ}" || unzip -d "${UPSTREAM_ROOTFOLDER}" "${UPSTREAM_TARBALLZZ}"
if [ `ls -1 "${UPSTREAM_ROOTFOLDER}" | wc -l` -eq 1 ]; then
	UPSTREAM_ROOTFOLDER="${UPSTREAM_ROOTFOLDER}/`ls -1 "${UPSTREAM_ROOTFOLDER}"`"
fi

DEBIAN_ROOTFOLDER="${REPACK_TMPDIR}/${DEBIAN_ROOTFOLDERNAME}"
## repack
####set -f
REPACK_WORKING_FOLDER=$(pwd)
cd "${UPSTREAM_ROOTFOLDER}"

####. "${REPACK_WORKING_FOLDER}/debian/repack.local"
## wipe out
####rm --verbose --force -- makefile.basic
## mimic autoreconf clean up
rm --verbose --force -- m4/ax_cc_maxopt.m4
rm --verbose --force -- m4/ax_check_compile_flag.m4
rm --verbose --force -- m4/ax_compiler_vendor.m4
rm --verbose --force -- m4/ax_gcc_archflag.m4
rm --verbose --force -- m4/ax_gcc_x86_cpuid.m4
rm --verbose --force -- m4/lt~obsolete.m4
rm --verbose --force -- m4/ltsugar.m4
rm --verbose --force -- m4/ltoptions.m4
rm --verbose --force -- m4/ltversion.m4
rm --verbose --force -- m4/libtool.m4
rm --verbose --force -- build-aux/compile
rm --verbose --force -- build-aux/depcomp
rm --verbose --force -- build-aux/ltmain.sh
rm --verbose --force -- build-aux/missing
rm --verbose --force -- build-aux/config.guess
rm --verbose --force -- build-aux/config.sub
rm --verbose --force -- build-aux/install-sh
rmdir --verbose -- build-aux
rm --verbose --force -- src/floatconfig.h
rm --verbose --force -- src/Makefile.in
rm --verbose --force -- doc/Makefile.in
####rm --verbose --force -- lib/Makefile.in
####rm --verbose --force -- tst/Makefile.in
rm --verbose --force -- Makefile.in
rm --verbose --force -- config.h.in
rm --verbose --force -- config.status
rm --verbose --force -- configure
rm --verbose --force -- libtool
rm --verbose --force -- aclocal.m4
## mimic make clean up
rm --verbose --force -- doc/floatbib.xml
rm --verbose --force -- doc/chap*.txt
rm --verbose --force -- doc/chap*.html
rm --verbose --force -- doc/chooser.html
####rm --verbose --force -- doc/index.html
rm --verbose --force -- doc/float.{tex,aux,toc,log,bbl,blg,ind,idx,ilg,out,brf}
rm --verbose --force -- doc/float.pnr
rm --verbose --force -- doc/manual.{pdf,six,lab,css}
rm --verbose --force -- doc/lefttoc.css
rm --verbose --force -- doc/manual.{css,js}
rm --verbose --force -- doc/nocolorprompt.css
rm --verbose --force -- doc/ragged.css
rm --verbose --force -- doc/rainbow.js
rm --verbose --force -- doc/times.css
rm --verbose --force -- doc/toggless.{css,js}
#:

cd ${REPACK_WORKING_FOLDER}
set +f
## end
####if [ -n "${DEBIAN_ENCAPSULATEDFOLDERNAME}" ]; then
####	mkdir "${DEBIAN_ROOTFOLDER}"
####	mv "${UPSTREAM_ROOTFOLDER}" "${DEBIAN_ROOTFOLDER}/${DEBIAN_ENCAPSULATEDFOLDERNAME}"
####else
	mv "${UPSTREAM_ROOTFOLDER}" "${DEBIAN_ROOTFOLDER}"
####fi

REPACK_TARBALL="${REPACK_TMPDIR}/repacked.tar"
REPACK_TARBALLXZ="${REPACK_TARBALL}.xz"
( cd "${REPACK_TMPDIR}" && \
	find -L "${DEBIAN_ROOTFOLDERNAME}" -xdev -type f -print | sort | \
	tar -T-  --owner=root --group=root --mode=a+rX --create --file "${REPACK_TARBALL}" \
	)
xz -9e < "${REPACK_TARBALL}" > "${REPACK_TARBALLXZ}"
mv "${REPACK_TARBALLXZ}" "${DEBIAN_TARBALLXZ}"

message "Testing ${DEBIAN_TARBALLXZ}"

xz --verbose --test "${DEBIAN_TARBALLXZ}"

message "Printing information about ${DEBIAN_TARBALLXZ}"

xz --verbose --list "${DEBIAN_TARBALLXZ}"

message "Quitting"

##
## eos