index : devtools32 | |
Archlinux32 fork of devtools | gitolite user |
summaryrefslogtreecommitdiff |
-rw-r--r-- | .gitignore | 4 | ||||
-rw-r--r-- | Makefile | 128 | ||||
-rw-r--r-- | config/pacman/core-staging-with-build-support.conf | 99 | ||||
-rw-r--r-- | config/pacman/extra-staging-with-build-support.conf | 99 | ||||
-rw-r--r-- | config/setarch-aliases.d/i486 | 1 | ||||
-rw-r--r-- | config/setarch-aliases.d/pentium4 | 1 | ||||
-rw-r--r-- | src/arch-nspawn.in | 4 | ||||
-rw-r--r-- | src/archbuild.in | 16 | ||||
-rw-r--r-- | src/lib/valid-tags.sh | 1 | ||||
-rw-r--r-- | src/makechrootpkg.in | 12 | ||||
-rw-r--r-- | src/mkarchroot.in | 5 |
@@ -1,3 +1,3 @@ *~ -devtools-*.tar.gz* -/build/ +devtools32-*.tar.gz* +build/ @@ -1,6 +1,5 @@ +V=$(shell git describe --exact-match) SHELL=/bin/bash - -V=1.0.2 BUILDTOOLVER ?= $(V) PREFIX = /usr/local @@ -19,6 +18,41 @@ PACMAN_CONFIGS=$(wildcard config/pacman/*) SETARCH_ALIASES = $(wildcard config/setarch-aliases.d/*) MANS = $(addprefix $(BUILDDIR)/,$(patsubst %.asciidoc,%,$(wildcard doc/man/*.asciidoc))) +GENERATED_PACMAN_CONFIGS = \ + core-testing-i486.conf \ + core-testing-i686.conf \ + core-testing-pentium4.conf \ + core-staging-i486.conf \ + core-staging-i686.conf \ + core-staging-pentium4.conf \ + core-staging-with-build-support-i486.conf \ + core-staging-with-build-support-i686.conf \ + core-staging-with-build-support-pentium4.conf \ + extra-i486.conf \ + extra-i686.conf \ + extra-pentium4.conf \ + extra-testing-i486.conf \ + extra-testing-i686.conf \ + extra-testing-pentium4.conf \ + extra-staging-i486.conf \ + extra-staging-i686.conf \ + extra-staging-pentium4.conf \ + extra-staging-with-build-support-i486.conf \ + extra-staging-with-build-support-i686.conf \ + extra-staging-with-build-support-pentium4.conf \ + kde-unstable-i486.conf \ + kde-unstable-i686.conf \ + kde-unstable-pentium4.conf \ + gnome-unstable-i486.conf \ + gnome-unstable-i686.conf \ + gnome-unstable-pentium4.conf +GENERATED_MAKEPKG_CONFIGS = \ + i486.conf \ + i686.conf \ + pentium4.conf +GENERATED_PACMAN_CONFIGS := $(addprefix $(BUILDDIR)/pacman.conf.d/,$(GENERATED_PACMAN_CONFIGS)) +GENERATED_MAKEPKG_CONFIGS := $(addprefix $(BUILDDIR)/makepkg.conf.d/,$(GENERATED_MAKEPKG_CONFIGS)) + COMMITPKG_LINKS = \ core-testingpkg \ core-stagingpkg \ @@ -32,29 +66,58 @@ COMMITPKG_LINKS = \ gnome-unstablepkg ARCHBUILD_LINKS = \ + core-testing-i486-build \ + core-testing-i686-build \ + core-testing-pentium4-build \ core-testing-x86_64-build \ core-testing-x86_64_v3-build \ + core-staging-i486-build \ + core-staging-i686-build \ + core-staging-pentium4-build \ core-staging-x86_64-build \ core-staging-x86_64_v3-build \ + core-staging-x86_64-build \ + core-staging-with-build-support-i486-build \ + core-staging-with-build-support-i686-build \ + core-staging-with-build-support-pentium4-build \ + extra-i486-build \ + extra-i686-build \ + extra-pentium4-build \ extra-x86_64-build \ extra-x86_64_v3-build \ + extra-testing-i486-build \ + extra-testing-i686-build \ + extra-testing-pentium4-build \ extra-testing-x86_64-build \ extra-testing-x86_64_v3-build \ + extra-staging-i486-build \ + extra-staging-i686-build \ + extra-staging-pentium4-build \ extra-staging-x86_64-build \ extra-staging-x86_64_v3-build \ + extra-staging-with-build-support-i486-build \ + extra-staging-with-build-support-i686-build \ + extra-staging-with-build-support-pentium4-build \ multilib-build \ multilib-testing-build \ multilib-staging-build \ + kde-unstable-i486-build \ + kde-unstable-i686-build \ + kde-unstable-pentium4-build \ kde-unstable-x86_64-build \ + gnome-unstable-i486-build \ + gnome-unstable-i686-build \ + gnome-unstable-pentium4-build \ gnome-unstable-x86_64-build COMPLETIONS = $(addprefix $(BUILDDIR)/,$(patsubst %.in,%,$(wildcard contrib/completion/*/*))) -all: binprogs library conf completion man +all: binprogs library conf completion man configfiles binprogs: $(BINPROGS) library: $(LIBRARY) completion: $(COMPLETIONS) +configfiles: $(GENERATED_MAKEPKG_CONFIGS) $(GENERATED_PACMAN_CONFIGS) man: $(MANS) @@ -77,6 +140,56 @@ edit = sed \ -e "s|@buildtoolver[@]|$(BUILDTOOLVER)|g" GEN_MSG = @echo "GEN $(patsubst $(BUILDDIR)/%,%,$@)" +$(BUILDDIR)/makepkg.conf.d/i486.conf: config/makepkg/x86_64.conf + @echo "GEN $(notdir $@)" + @mkdir -p $(dir $@) + @sed " \ + s,\(["'"'"=]\)x86[-_]64\([-"'"'" ]\),\1i486\2,g; \ + s,-fcf-protection,,g; \ + s,LTOFLAGS=".*",LTOFLAGS=\"-fno-lto\",g; \ + /OPTIONS=/s/ lto/ !lto/; \ + " "$<" > "$@" + @sed -i 's/--ultra -20/--ultra -19/' "$@" + +$(BUILDDIR)/makepkg.conf.d/i686.conf: config/makepkg/x86_64.conf + @echo "GEN $(notdir $@)" + @mkdir -p $(dir $@) + @sed " \ + s,\(["'"'"=]\)x86[-_]64\([-"'"'" ]\),\1i686\2,g; \ + s,-fcf-protection,,g; \ + " "$<" > "$@" + @sed -i 's/--ultra -20/--ultra -19/' "$@" + +$(BUILDDIR)/makepkg.conf.d/pentium4.conf: $(BUILDDIR)/makepkg.conf.d/i686.conf + @echo "GEN $(notdir $@)" + @mkdir -p $(dir $@) + @sed '/^CHOST=/ ! s,\(["=]\)i686\([-" ]\),\1pentium4\2,g' "$<" > "$@" + @sed -i 's/--ultra -20/--ultra -19/' "$@" + +$(BUILDDIR)/pacman.conf.d/%-i486.conf: config/pacman/%.conf + @echo "GEN $(notdir $@)" + @mkdir -p $(dir $@) + @sed " \ + s,/mirrorlist\$$,\032,; \ + /^Architecture = / s/^.*\$$/Architecture = i486/; \ + " "$<" > "$@" + +$(BUILDDIR)/pacman.conf.d/%-i686.conf: config/pacman/%.conf + @echo "GEN $(notdir $@)" + @mkdir -p $(dir $@) + @sed " \ + s,/mirrorlist\$$,\032,; \ + /^Architecture = / s/^.*$$/Architecture = i686/ \ + " "$<" > "$@" + +$(BUILDDIR)/pacman.conf.d/%-pentium4.conf: config/pacman/%.conf + @echo "GEN $(notdir $@)" + @mkdir -p $(dir $@) + @sed " \ + s,/mirrorlist\$$,\032,; \ + /^Architecture = / s/^.*$$/Architecture = pentium4/ \ + " "$<" > "$@" + define buildInScript $(1)/%: $(2)%$(3) $$(GEN_MSG) @@ -113,7 +226,9 @@ install: all install -dm0755 $(DESTDIR)$(DATADIR)/lib cp -ra $(BUILDDIR)/lib/* $(DESTDIR)$(DATADIR)/lib for conf in $(notdir $(MAKEPKG_CONFIGS)); do install -Dm0644 $(BUILDDIR)/makepkg.conf.d/$$conf $(DESTDIR)$(DATADIR)/makepkg.conf.d/$${conf##*/}; done + for conf in $(notdir $(GENERATED_MAKEPKG_CONFIGS)); do install -Dm0644 $(BUILDDIR)/makepkg.conf.d/$$conf $(DESTDIR)$(DATADIR)/makepkg.conf.d/$${conf##*/}; done for conf in $(notdir $(PACMAN_CONFIGS)); do install -Dm0644 $(BUILDDIR)/pacman.conf.d/$$conf $(DESTDIR)$(DATADIR)/pacman.conf.d/$${conf##*/}; done + for conf in $(notdir $(GENERATED_PACMAN_CONFIGS)); do install -Dm0644 $(BUILDDIR)/pacman.conf.d/$$conf $(DESTDIR)$(DATADIR)/pacman.conf.d/$${conf##*/}; done for a in ${SETARCH_ALIASES}; do install -m0644 $$a -t $(DESTDIR)$(DATADIR)/setarch-aliases.d; done for l in ${COMMITPKG_LINKS}; do ln -sf commitpkg $(DESTDIR)$(PREFIX)/bin/$$l; done for l in ${ARCHBUILD_LINKS}; do ln -sf archbuild $(DESTDIR)$(PREFIX)/bin/$$l; done @@ -156,8 +271,11 @@ release: dist glab release create v$(RELEASE) devtools-$(RELEASE).tar.gz* dist: - git archive --format=tar --prefix=devtools-$(V)/ v$(V) | gzip > devtools-$(V).tar.gz - gpg --detach-sign --use-agent devtools-$(V).tar.gz + git archive --format=tar --prefix=devtools32-$(V)/ v$(V) | gzip > devtools32-$(V).tar.gz + gpg --detach-sign --use-agent devtools32-$(V).tar.gz + +upload: + scp devtools32-$(V).tar.gz devtools32-$(V).tar.gz.sig sources.archlinux32.org:httpdocs/sources/ check: $(BINPROGS_SRC) $(LIBRARY_SRC) contrib/completion/bash/devtools.in config/makepkg/x86_64.conf contrib/makepkg/PKGBUILD.proto shellcheck $^ diff --git a/config/pacman/core-staging-with-build-support.conf b/config/pacman/core-staging-with-build-support.conf new file mode 100644 index 0000000..7b62e6f --- /dev/null +++ b/config/pacman/core-staging-with-build-support.conf @@ -0,0 +1,99 @@ +# +# /etc/pacman.conf +# +# See the pacman.conf(5) manpage for option and repository directives + +# +# GENERAL OPTIONS +# +[options] +# The following paths are commented out with their default values listed. +# If you wish to use different paths, uncomment and update the paths. +#RootDir = / +#DBPath = /var/lib/pacman/ +#CacheDir = /var/cache/pacman/pkg/ +#LogFile = /var/log/pacman.log +#GPGDir = /etc/pacman.d/gnupg/ +#HookDir = /etc/pacman.d/hooks/ +HoldPkg = pacman glibc +#XferCommand = /usr/bin/curl -C - -f %u > %o +#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u +#CleanMethod = KeepInstalled +#UseDelta = 0.7 +Architecture = auto + +# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup +#IgnorePkg = +#IgnoreGroup = + +#NoUpgrade = +#NoExtract = + +# Misc options +#UseSyslog +#Color +#TotalDownload +# We cannot check disk space from within a chroot environment +#CheckSpace +#VerbosePkgLists + +# By default, pacman accepts packages signed by keys that its local keyring +# trusts (see pacman-key and its man page), as well as unsigned packages. +SigLevel = Required DatabaseOptional +LocalFileSigLevel = Optional +#RemoteFileSigLevel = Required + +# NOTE: You must run `pacman-key --init` before first using pacman; the local +# keyring can then be populated with the keys of all official Arch Linux +# packagers with `pacman-key --populate archlinux`. + +# +# REPOSITORIES +# - can be defined here or included from another file +# - pacman will search repositories in the order defined here +# - local/custom mirrors can be added here or in separate files +# - repositories listed first will take precedence when packages +# have identical names, regardless of version number +# - URLs will have $repo replaced by the name of the current repo +# - URLs will have $arch replaced by the name of the architecture +# +# Repository entries are of the format: +# [repo-name] +# Server = ServerName +# Include = IncludePath +# +# The header [repo-name] is crucial - it must be present and +# uncommented to enable the repo. +# + +# The testing repositories are disabled by default. To enable, uncomment the +# repo name header and Include lines. You can add preferred servers immediately +# after the header, and they will be used before the default mirrors. + +[build-support] +Include = /etc/pacman.d/mirrorlist + +[core-staging] +Include = /etc/pacman.d/mirrorlist + +[extra-staging] +Include = /etc/pacman.d/mirrorlist + +[core-testing] +Include = /etc/pacman.d/mirrorlist + +[core] +Include = /etc/pacman.d/mirrorlist + +[extra-testing] +Include = /etc/pacman.d/mirrorlist + +[extra] +Include = /etc/pacman.d/mirrorlist + +# An example of a custom package repository. See the pacman manpage for +# tips on creating your own repositories. +#[custom] +#SigLevel = Optional TrustAll +#Server = file:///home/custompkgs + diff --git a/config/pacman/extra-staging-with-build-support.conf b/config/pacman/extra-staging-with-build-support.conf new file mode 100644 index 0000000..7b62e6f --- /dev/null +++ b/config/pacman/extra-staging-with-build-support.conf @@ -0,0 +1,99 @@ +# +# /etc/pacman.conf +# +# See the pacman.conf(5) manpage for option and repository directives + +# +# GENERAL OPTIONS +# +[options] +# The following paths are commented out with their default values listed. +# If you wish to use different paths, uncomment and update the paths. +#RootDir = / +#DBPath = /var/lib/pacman/ +#CacheDir = /var/cache/pacman/pkg/ +#LogFile = /var/log/pacman.log +#GPGDir = /etc/pacman.d/gnupg/ +#HookDir = /etc/pacman.d/hooks/ +HoldPkg = pacman glibc +#XferCommand = /usr/bin/curl -C - -f %u > %o +#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u +#CleanMethod = KeepInstalled +#UseDelta = 0.7 +Architecture = auto + +# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup +#IgnorePkg = +#IgnoreGroup = + +#NoUpgrade = +#NoExtract = + +# Misc options +#UseSyslog +#Color +#TotalDownload +# We cannot check disk space from within a chroot environment +#CheckSpace +#VerbosePkgLists + +# By default, pacman accepts packages signed by keys that its local keyring +# trusts (see pacman-key and its man page), as well as unsigned packages. +SigLevel = Required DatabaseOptional +LocalFileSigLevel = Optional +#RemoteFileSigLevel = Required + +# NOTE: You must run `pacman-key --init` before first using pacman; the local +# keyring can then be populated with the keys of all official Arch Linux +# packagers with `pacman-key --populate archlinux`. + +# +# REPOSITORIES +# - can be defined here or included from another file +# - pacman will search repositories in the order defined here +# - local/custom mirrors can be added here or in separate files +# - repositories listed first will take precedence when packages +# have identical names, regardless of version number +# - URLs will have $repo replaced by the name of the current repo +# - URLs will have $arch replaced by the name of the architecture +# +# Repository entries are of the format: +# [repo-name] +# Server = ServerName +# Include = IncludePath +# +# The header [repo-name] is crucial - it must be present and +# uncommented to enable the repo. +# + +# The testing repositories are disabled by default. To enable, uncomment the +# repo name header and Include lines. You can add preferred servers immediately +# after the header, and they will be used before the default mirrors. + +[build-support] +Include = /etc/pacman.d/mirrorlist + +[core-staging] +Include = /etc/pacman.d/mirrorlist + +[extra-staging] +Include = /etc/pacman.d/mirrorlist + +[core-testing] +Include = /etc/pacman.d/mirrorlist + +[core] +Include = /etc/pacman.d/mirrorlist + +[extra-testing] +Include = /etc/pacman.d/mirrorlist + +[extra] +Include = /etc/pacman.d/mirrorlist + +# An example of a custom package repository. See the pacman manpage for +# tips on creating your own repositories. +#[custom] +#SigLevel = Optional TrustAll +#Server = file:///home/custompkgs + diff --git a/config/setarch-aliases.d/i486 b/config/setarch-aliases.d/i486 new file mode 100644 index 0000000..193dd70 --- /dev/null +++ b/config/setarch-aliases.d/i486 @@ -0,0 +1 @@ +i686 diff --git a/config/setarch-aliases.d/pentium4 b/config/setarch-aliases.d/pentium4 new file mode 100644 index 0000000..193dd70 --- /dev/null +++ b/config/setarch-aliases.d/pentium4 @@ -0,0 +1 @@ +i686 diff --git a/src/arch-nspawn.in b/src/arch-nspawn.in index 1453ba0..11af616 100644 --- a/src/arch-nspawn.in +++ b/src/arch-nspawn.in @@ -94,7 +94,9 @@ copy_hostconf () { unshare --fork --pid gpg --homedir "$working_dir"/etc/pacman.d/gnupg/ --no-permission-warning --quiet --batch --import --import-options import-local-sigs "$(pacman-conf GpgDir)"/pubring.gpg >/dev/null 2>&1 pacman-key --gpgdir "$working_dir"/etc/pacman.d/gnupg/ --import-trustdb "$(pacman-conf GpgDir)" >/dev/null 2>&1 - printf 'Server = %s\n' "${host_mirrors[@]}" >"$working_dir/etc/pacman.d/mirrorlist" + printf 'Server = %s\n' "${host_mirrors[@]}" | \ + tee "$working_dir/etc/pacman.d/mirrorlist" > \ + "$working_dir/etc/pacman.d/mirrorlist32" [[ -n $pac_conf ]] && cp "$pac_conf" "$working_dir/etc/pacman.conf" [[ -n $makepkg_conf ]] && cp "$makepkg_conf" "$working_dir/etc/makepkg.conf" diff --git a/src/archbuild.in b/src/archbuild.in index 2f3faf9..d023e0d 100644 --- a/src/archbuild.in +++ b/src/archbuild.in @@ -76,6 +76,14 @@ done check_root SOURCE_DATE_EPOCH,SRCDEST,SRCPKGDEST,PKGDEST,LOGDEST,MAKEFLAGS,PACKAGER,GNUPGHOME "${BASH_SOURCE[0]}" "$@" +if [ "${arch}" = "x86_64" ]; then + cache_dir='' +else + mkdir -p '/var/cache/archbuild32' + cache_dir='-c/var/cache/archbuild32' + makechrootpkg_args+=('-d/var/cache/archbuild32:/var/cache/pacman/pkg') +fi + # Pass all arguments after -- right to makepkg makechrootpkg_args+=("${@:$OPTIND}") @@ -89,6 +97,12 @@ if ${clean_first} || [[ ! -d "${chroots}/${repo}-${arch}" ]]; then lock 9 "$copy.lock" "Locking chroot copy '%s'" "$copy" subvolume_delete_recursive "${copy}" + find "${copy}" \ + -mindepth 1 \ + -type d \ + -exec mountpoint -q {} \; \ + -prune \ + -exec umount -l {} \; rm -rf --one-file-system "${copy}" done lock_close 9 @@ -98,6 +112,7 @@ if ${clean_first} || [[ ! -d "${chroots}/${repo}-${arch}" ]]; then setarch "${set_arch}" mkarchroot \ -C "${pacman_config}" \ -M "${makepkg_config}" \ + ${cache_dir} \ "${chroots}/${repo}-${arch}/root" \ "${base_packages[@]}" || abort else @@ -105,6 +120,7 @@ else arch-nspawn \ -C "${pacman_config}" \ -M "${makepkg_config}" \ + ${cache_dir} \ "${chroots}/${repo}-${arch}/root" \ pacman -Syuu --noconfirm || abort fi diff --git a/src/lib/valid-tags.sh b/src/lib/valid-tags.sh index ca8d7d7..5382c5c 100644 --- a/src/lib/valid-tags.sh +++ b/src/lib/valid-tags.sh @@ -5,6 +5,7 @@ # shellcheck disable=2034 _arch=( + i686 x86_64 any ) diff --git a/src/makechrootpkg.in b/src/makechrootpkg.in index 2cfd849..aac7a0b 100644 --- a/src/makechrootpkg.in +++ b/src/makechrootpkg.in @@ -176,6 +176,9 @@ prepare_chroot() { grep -q "^$x" "$copydir/etc/makepkg.conf" && continue echo "$x" >>"$copydir/etc/makepkg.conf" done + if [ -n "${PKGEXT}" ]; then + sed -i 's/^PKGEXT=.*/PKGEXT='"'${PKGEXT}'"'/' "$copydir/etc/makepkg.conf" + fi cat > "$copydir/etc/sudoers.d/builduser-pacman" <<EOF builduser ALL = NOPASSWD: /usr/bin/pacman @@ -209,6 +212,9 @@ _chrootbuild() { # shellcheck source=/dev/null . /etc/profile + # otherwise we might have missing keys + pacman-key --populate + # Beware, there are some stupid arbitrary rules on how you can # use "$" in arguments to commands with "sudo -i". ${foo} or # ${1} is OK, but $foo or $1 isn't. @@ -228,7 +234,10 @@ _chrootbuild() { _chrootnamcap() { pacman -S --needed --noconfirm namcap - for pkgfile in /startdir/PKGBUILD /pkgdest/*; do + for pkgfile in /startdir/PKGBUILD /startdir/*.pkg.tar.xz /pkgdest/*; do + if [ ! -f "${pkgfile}" ]; then + continue + fi echo "Checking ${pkgfile##*/}" sudo -u builduser namcap "$pkgfile" 2>&1 | tee "/logdest/${pkgfile##*/}-namcap.log" done @@ -331,6 +340,7 @@ done umask 0022 ORIG_HOME=$HOME +PKGEXT=$PKGEXT IFS=: read -r _ _ _ _ _ HOME _ < <(getent passwd "${SUDO_USER:-$USER}") load_makepkg_config HOME=$ORIG_HOME diff --git a/src/mkarchroot.in b/src/mkarchroot.in index fc60b4e..2abe001 100644 --- a/src/mkarchroot.in +++ b/src/mkarchroot.in @@ -91,12 +91,15 @@ done unshare --mount pacstrap -${umode}Mc ${pac_conf:+-C "$pac_conf"} "$working_dir" \ "${cache_dirs[@]/#/--cachedir=}" "$@" || die 'Failed to install all packages' -printf '%s.UTF-8 UTF-8\n' en_US de_DE > "$working_dir/etc/locale.gen" +printf '%s.UTF-8 UTF-8\n' C en_US de_DE > "$working_dir/etc/locale.gen" +cat '/etc/hosts' > "$working_dir/etc/hosts" echo 'LANG=C.UTF-8' > "$working_dir/etc/locale.conf" echo "$CHROOT_VERSION" > "$working_dir/.arch-chroot" systemd-machine-id-setup --root="$working_dir" +pacman-key --gpgdir "$working_dir"/etc/pacman.d/gnupg --init + exec arch-nspawn \ "${nspawn_args[@]}" \ "$working_dir" locale-gen |