-
Notifications
You must be signed in to change notification settings - Fork 56
/
Copy pathcreate-ubuntu-repo.sh
executable file
·66 lines (51 loc) · 1.44 KB
/
create-ubuntu-repo.sh
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
#!/bin/sh
set -e
#DISTS and DISTRO must be defined.
SRCDIR=$(pwd)
ARCHS="i386 amd64 source"
cd build/$DISTRO
rm -rf dists
mkdir -p .cache
for DIST in $DISTS; do
mkdir -p dists/$DIST/main/binary-amd64
mkdir -p dists/$DIST/main/binary-i386
mkdir -p dists/$DIST/main/source
cat > apt-ftparchive.conf <<EOF
Dir {
ArchiveDir ".";
CacheDir "./.cache";
};
Default {
Packages::Compress ". gzip bzip2";
Contents::Compress ". gzip bzip2";
};
TreeDefault {
BinCacheDB "packages-\$(SECTION)-\$(ARCH).db";
Directory "pool/\$(SECTION)";
SrcDirectory "pool/\$(SECTION)";
Packages "\$(DIST)/\$(SECTION)/binary-\$(ARCH)/Packages";
Contents "\$(DIST)/Contents-\$(ARCH)";
};
Tree "dists/$DIST" {
Sections "main";
Architectures "i386 amd64 source";
}
EOF
apt-ftparchive generate apt-ftparchive.conf
cat > apt-release.conf <<EOF
APT::FTPArchive::Release::Codename "$DIST";
APT::FTPArchive::Release::Origin "Dropbox.com";
APT::FTPArchive::Release::Components "main";
APT::FTPArchive::Release::Label "Dropbox $DISTRO Repository";
APT::FTPArchive::Release::Architectures "$ARCHS";
APT::FTPArchive::Release::Suite "$DIST";
EOF
apt-ftparchive -c apt-release.conf release dists/$DIST > dists/$DIST/Release
done
rm -rf apt-release.conf apt-ftparchive.conf
# Create symlinks for packages.
mkdir -p $SRCDIR/build/packages/$DISTRO
for F in pool/main/*.deb; do
echo Symlinking $F
ln -sf ../../$DISTRO/$F $SRCDIR/build/packages/$DISTRO/
done