forked from dropbox/nautilus-dropbox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
create-ubuntu-repo.sh
55 lines (42 loc) · 1.25 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
#!/bin/sh -e
#DISTS and DISTRO must be defined.
ARCHS="i386 amd64 source"
mkdir .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
gpg -abs -o dists/$DIST/Release.gpg dists/$DIST/Release
done
rm -rf apt-release.conf apt-ftparchive.conf