index : devtools32 | |
Archlinux32 fork of devtools | gitolite user |
summaryrefslogtreecommitdiff |
-rw-r--r-- | .gitignore | 8 | ||||
-rw-r--r-- | Makefile | 103 | ||||
-rw-r--r-- | arch-nspawn.in | 6 | ||||
-rw-r--r-- | archbuild.in | 18 | ||||
-rw-r--r-- | lib/valid-tags.sh | 19 | ||||
-rw-r--r-- | makechrootpkg.in | 12 | ||||
-rw-r--r-- | mkarchroot.in | 3 | ||||
-rw-r--r-- | pacman-extra.conf | 6 | ||||
-rw-r--r-- | pacman-gnome-unstable.conf | 6 | ||||
-rw-r--r-- | pacman-kde-unstable.conf | 6 | ||||
-rw-r--r-- | pacman-multilib-staging.conf | 10 | ||||
-rw-r--r-- | pacman-multilib-testing.conf | 6 | ||||
-rw-r--r-- | pacman-multilib.conf | 6 | ||||
-rw-r--r-- | pacman-staging-with-build-support.conf | 102 | ||||
-rw-r--r-- | pacman-staging.conf | 10 | ||||
-rw-r--r-- | pacman-testing.conf | 6 | ||||
-rw-r--r-- | setarch-aliases.d/pentium4 | 1 |
@@ -1,5 +1,5 @@ *~ -devtools-*.tar.gz* +devtools32-*.tar.gz* archbuild archco archrelease @@ -22,3 +22,9 @@ arch-nspawn sogrep doc/*.1 doc/*.7 +pacman-*-i486.conf +pacman-*-i686.conf +pacman-*-pentium4.conf +makepkg-i486.conf +makepkg-i686.conf +makepkg-pentium4.conf @@ -1,4 +1,4 @@ -V=20220621 +V=$(shell git describe --exact-match) BUILDTOOLVER ?= $(V) PREFIX = /usr/local @@ -27,6 +27,29 @@ IN_PROGS = \ BINPROGS = \ $(IN_PROGS) +GENERATED_CONFIGFILES = \ + pacman-extra-i486.conf \ + pacman-extra-i686.conf \ + pacman-extra-pentium4.conf \ + pacman-testing-i486.conf \ + pacman-testing-i686.conf \ + pacman-testing-pentium4.conf \ + pacman-staging-i486.conf \ + pacman-staging-i686.conf \ + pacman-staging-pentium4.conf \ + pacman-staging-with-build-support-i486.conf \ + pacman-staging-with-build-support-i686.conf \ + pacman-staging-with-build-support-pentium4.conf \ + pacman-kde-unstable-i486.conf \ + pacman-kde-unstable-i686.conf \ + pacman-kde-unstable-pentium4.conf \ + pacman-gnome-unstable-i486.conf \ + pacman-gnome-unstable-i686.conf \ + pacman-gnome-unstable-pentium4.conf \ + makepkg-i486.conf \ + makepkg-i686.conf \ + makepkg-pentium4.conf + CONFIGFILES = \ makepkg-x86_64.conf \ makepkg-x86_64_v3.conf \ @@ -40,10 +63,12 @@ CONFIGFILES = \ pacman-multilib-testing.conf \ pacman-multilib-staging.conf \ pacman-kde-unstable.conf \ - pacman-gnome-unstable.conf + pacman-gnome-unstable.conf \ + $(GENERATED_CONFIGFILES) SETARCH_ALIASES = \ - x86_64_v3 + i486 \ + pentium4 COMMITPKG_LINKS = \ extrapkg \ @@ -59,16 +84,31 @@ COMMITPKG_LINKS = \ gnome-unstablepkg ARCHBUILD_LINKS = \ + extra-i486-build \ + extra-i686-build \ + extra-pentium4-build \ extra-x86_64-build \ - extra-x86_64_v3-build \ + testing-i486-build \ + testing-i686-build \ + testing-pentium4-build \ testing-x86_64-build \ - testing-x86_64_v3-build \ + staging-i486-build \ + staging-i686-build \ + staging-pentium4-build \ staging-x86_64-build \ - staging-x86_64_v3-build \ + staging-with-build-support-i486-build \ + staging-with-build-support-i686-build \ + 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 CROSSREPOMOVE_LINKS = \ @@ -97,11 +137,52 @@ MANS = \ doc/devtools.7 -all: $(BINPROGS) bash_completion zsh_completion man +all: $(GENERATED_CONFIGFILES) $(BINPROGS) bash_completion zsh_completion man man: $(MANS) edit = sed -e "s|@pkgdatadir[@]|$(PREFIX)/share/devtools|g" +makepkg-i486.conf: makepkg-x86_64.conf + @echo "GEN $@" + @sed " \ + s,\(["'"'"=]\)x86[-_]64\([-"'"'" ]\),\1i486\2,g; \ + s,-fcf-protection,,g; \ + s,LTOFLAGS=".*",LTOFLAGS=\"-fno-lto\",g; \ + /OPTIONS=/s/ lto/ !lto/; \ + " "$<" > "$@" + +makepkg-i686.conf: makepkg-x86_64.conf + @echo "GEN $@" + @sed " \ + s,\(["'"'"=]\)x86[-_]64\([-"'"'" ]\),\1i686\2,g; \ + s,-fcf-protection,,g; \ + " "$<" > "$@" + +makepkg-pentium4.conf: makepkg-i686.conf + @echo "GEN $@" + @sed '/^CHOST=/ ! s,\(["=]\)i686\([-" ]\),\1pentium4\2,g' "$<" > "$@" + +pacman-%-i486.conf: pacman-%.conf + @echo "GEN $@" + @sed " \ + s,/mirrorlist\$$,\032,; \ + /^Architecture = / s/^.*\$$/Architecture = i486/; \ + " "$<" > "$@" + +pacman-%-i686.conf: pacman-%.conf + @echo "GEN $@" + @sed " \ + s,/mirrorlist\$$,\032,; \ + /^Architecture = / s/^.*$$/Architecture = i686/ \ + " "$<" > "$@" + +pacman-%-pentium4.conf: pacman-%.conf + @echo "GEN $@" + @sed " \ + s,/mirrorlist\$$,\032,; \ + /^Architecture = / s/^.*$$/Architecture = pentium4/ \ + " "$<" > "$@" + %: %.in Makefile lib/common.sh @echo "GEN $@" @$(RM) "$@" @@ -116,7 +197,7 @@ doc/%: doc/%.asciidoc a2x --no-xmllint --asciidoc-opts="-f doc/asciidoc.conf" -d manpage -f manpage -D doc -a pkgdatadir=$(PREFIX)/share/devtools $< clean: - rm -f $(IN_PROGS) bash_completion zsh_completion $(MANS) + rm -f $(GENERATED_CONFIGFILES) $(IN_PROGS) bash_completion zsh_completion $(MANS) install: install -dm0755 $(DESTDIR)$(PREFIX)/bin @@ -159,11 +240,11 @@ tag: @git tag --sign --message "Version $(TODAY)" $(TODAY) dist: - git archive --format=tar --prefix=devtools-$(V)/ $(V) | gzip > devtools-$(V).tar.gz - gpg --detach-sign --use-agent devtools-$(V).tar.gz + git archive --format=tar --prefix=devtools32-$(V)/ $(V) | gzip -9 > devtools32-$(V).tar.gz + gpg --detach-sign --use-agent devtools32-$(V).tar.gz upload: - scp devtools-$(V).tar.gz devtools-$(V).tar.gz.sig repos.archlinux.org:/srv/ftp/other/devtools/ + scp devtools32-$(V).tar.gz devtools32-$(V).tar.gz.sig sources.archlinux32.org:httpdocs/sources/ check: $(BINPROGS) bash_completion makepkg-x86_64.conf PKGBUILD.proto shellcheck $^ diff --git a/arch-nspawn.in b/arch-nspawn.in index 275cff7..ae50043 100644 --- a/arch-nspawn.in +++ b/arch-nspawn.in @@ -54,7 +54,7 @@ if (( ${#cache_dirs[@]} == 0 )); then fi # shellcheck disable=2016 -host_mirrors=($(pacman-conf --repo extra Server 2> /dev/null | sed -r 's#(.*/)extra/os/.*#\1$repo/os/$arch#')) +host_mirrors=($(pacman-conf --config "${pac_conf:-$working_dir/etc/pacman.conf}" --repo extra Server 2> /dev/null | sed -r 's#(.*/)extra/os/.*#\1$repo/os/$arch#;t;s#(.*/)[^/]+/extra(/?)$#\1$arch/$repo\2#')) for host_mirror in "${host_mirrors[@]}"; do if [[ $host_mirror == *file://* ]]; then @@ -87,7 +87,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/archbuild.in b/archbuild.in index e6cf19a..a5eb9a0 100644 --- a/archbuild.in +++ b/archbuild.in @@ -54,7 +54,15 @@ while getopts 'hcr:' arg; do esac done -check_root SOURCE_DATE_EPOCH,SRCDEST,SRCPKGDEST,PKGDEST,LOGDEST,MAKEFLAGS,PACKAGER,GNUPGHOME +check_root SOURCE_DATE_EPOCH,SRCDEST,SRCPKGDEST,PKGDEST,LOGDEST,MAKEFLAGS,PACKAGER,GNUPGHOME,PKGEXT + +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}") @@ -69,6 +77,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 @@ -78,6 +92,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 @@ -85,6 +100,7 @@ else arch-nspawn \ -C "${pacman_config}" \ -M "${makepkg_config}" \ + ${cache_dir} \ "${chroots}/${repo}-${arch}/root" \ pacman -Syuu --noconfirm || abort fi diff --git a/lib/valid-tags.sh b/lib/valid-tags.sh index d628fd1..0e8366e 100644 --- a/lib/valid-tags.sh +++ b/lib/valid-tags.sh @@ -5,22 +5,23 @@ # shellcheck disable=2034 _arch=( + i686 x86_64 any ) # shellcheck disable=2034 _tags=( - core-x86_64 core-any - extra-x86_64 extra-any + core-i686 core-x86_64 core-any + extra-i686 extra-x86_64 extra-any multilib-x86_64 - staging-x86_64 staging-any - testing-x86_64 testing-any + staging-i686 staging-x86_64 staging-any + testing-i686 testing-x86_64 testing-any multilib-testing-x86_64 multilib-staging-x86_64 - community-x86_64 community-any - community-staging-x86_64 community-staging-any - community-testing-x86_64 community-testing-any - kde-unstable-x86_64 kde-unstable-any - gnome-unstable-x86_64 gnome-unstable-any + community-i686 community-x86_64 community-any + community-staging-i686 community-staging-x86_64 community-staging-any + community-testing-i686 community-testing-x86_64 community-testing-any + kde-unstable-i686 kde-unstable-x86_64 kde-unstable-any + gnome-unstable-i686 gnome-unstable-x86_64 gnome-unstable-any ) diff --git a/makechrootpkg.in b/makechrootpkg.in index 126d1da..3f63678 100644 --- a/makechrootpkg.in +++ b/makechrootpkg.in @@ -170,6 +170,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 @@ -203,6 +206,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. @@ -222,7 +228,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 @@ -324,6 +333,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/mkarchroot.in b/mkarchroot.in index d199bed..86c076b 100644 --- a/mkarchroot.in +++ b/mkarchroot.in @@ -85,11 +85,14 @@ unshare --mount pacstrap -${umode}Mcd ${pac_conf:+-C "$pac_conf"} "$working_dir" "${cache_dirs[@]/#/--cachedir=}" "$@" || die 'Failed to install all packages' 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 diff --git a/pacman-extra.conf b/pacman-extra.conf index 768c96d..e855f3c 100644 --- a/pacman-extra.conf +++ b/pacman-extra.conf @@ -73,15 +73,15 @@ LocalFileSigLevel = Optional #[testing] #Include = /etc/pacman.d/mirrorlist +#[community-testing] +#Include = /etc/pacman.d/mirrorlist + [core] Include = /etc/pacman.d/mirrorlist [extra] Include = /etc/pacman.d/mirrorlist -#[community-testing] -#Include = /etc/pacman.d/mirrorlist - [community] Include = /etc/pacman.d/mirrorlist diff --git a/pacman-gnome-unstable.conf b/pacman-gnome-unstable.conf index 93ce01b..d7ae13b 100644 --- a/pacman-gnome-unstable.conf +++ b/pacman-gnome-unstable.conf @@ -76,13 +76,13 @@ Include = /etc/pacman.d/mirrorlist [testing] Include = /etc/pacman.d/mirrorlist -[core] +[community-testing] Include = /etc/pacman.d/mirrorlist -[extra] +[core] Include = /etc/pacman.d/mirrorlist -[community-testing] +[extra] Include = /etc/pacman.d/mirrorlist [community] diff --git a/pacman-kde-unstable.conf b/pacman-kde-unstable.conf index 7308b61..6e6bfd8 100644 --- a/pacman-kde-unstable.conf +++ b/pacman-kde-unstable.conf @@ -76,13 +76,13 @@ Include = /etc/pacman.d/mirrorlist [testing] Include = /etc/pacman.d/mirrorlist -[core] +[community-testing] Include = /etc/pacman.d/mirrorlist -[extra] +[core] Include = /etc/pacman.d/mirrorlist -[community-testing] +[extra] Include = /etc/pacman.d/mirrorlist [community] diff --git a/pacman-multilib-staging.conf b/pacman-multilib-staging.conf index be04ea2..5b300c0 100644 --- a/pacman-multilib-staging.conf +++ b/pacman-multilib-staging.conf @@ -73,19 +73,19 @@ LocalFileSigLevel = Optional [staging] Include = /etc/pacman.d/mirrorlist -[testing] +[community-staging] Include = /etc/pacman.d/mirrorlist -[core] +[testing] Include = /etc/pacman.d/mirrorlist -[extra] +[community-testing] Include = /etc/pacman.d/mirrorlist -[community-staging] +[core] Include = /etc/pacman.d/mirrorlist -[community-testing] +[extra] Include = /etc/pacman.d/mirrorlist [community] diff --git a/pacman-multilib-testing.conf b/pacman-multilib-testing.conf index b7fcf71..db5b9cc 100644 --- a/pacman-multilib-testing.conf +++ b/pacman-multilib-testing.conf @@ -73,13 +73,13 @@ LocalFileSigLevel = Optional [testing] Include = /etc/pacman.d/mirrorlist -[core] +[community-testing] Include = /etc/pacman.d/mirrorlist -[extra] +[core] Include = /etc/pacman.d/mirrorlist -[community-testing] +[extra] Include = /etc/pacman.d/mirrorlist [community] diff --git a/pacman-multilib.conf b/pacman-multilib.conf index 9f1906c..1707f94 100644 --- a/pacman-multilib.conf +++ b/pacman-multilib.conf @@ -73,15 +73,15 @@ LocalFileSigLevel = Optional #[testing] #Include = /etc/pacman.d/mirrorlist +#[community-testing] +#Include = /etc/pacman.d/mirrorlist + [core] Include = /etc/pacman.d/mirrorlist [extra] Include = /etc/pacman.d/mirrorlist -#[community-testing] -#Include = /etc/pacman.d/mirrorlist - [community] Include = /etc/pacman.d/mirrorlist diff --git a/pacman-staging-with-build-support.conf b/pacman-staging-with-build-support.conf new file mode 100644 index 0000000..3d2c125 --- /dev/null +++ b/pacman-staging-with-build-support.conf @@ -0,0 +1,102 @@ +# +# /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 + +[staging] +Include = /etc/pacman.d/mirrorlist + +[community-staging] +Include = /etc/pacman.d/mirrorlist + +[testing] +Include = /etc/pacman.d/mirrorlist + +[community-testing] +Include = /etc/pacman.d/mirrorlist + +[core] +Include = /etc/pacman.d/mirrorlist + +[extra] +Include = /etc/pacman.d/mirrorlist + +[community] +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/pacman-staging.conf b/pacman-staging.conf index 666d94d..321a4e8 100644 --- a/pacman-staging.conf +++ b/pacman-staging.conf @@ -73,19 +73,19 @@ LocalFileSigLevel = Optional [staging] Include = /etc/pacman.d/mirrorlist -[testing] +[community-staging] Include = /etc/pacman.d/mirrorlist -[core] +[testing] Include = /etc/pacman.d/mirrorlist -[extra] +[community-testing] Include = /etc/pacman.d/mirrorlist -[community-staging] +[core] Include = /etc/pacman.d/mirrorlist -[community-testing] +[extra] Include = /etc/pacman.d/mirrorlist [community] diff --git a/pacman-testing.conf b/pacman-testing.conf index 79fcaa1..bf9003c 100644 --- a/pacman-testing.conf +++ b/pacman-testing.conf @@ -73,13 +73,13 @@ LocalFileSigLevel = Optional [testing] Include = /etc/pacman.d/mirrorlist -[core] +[community-testing] Include = /etc/pacman.d/mirrorlist -[extra] +[core] Include = /etc/pacman.d/mirrorlist -[community-testing] +[extra] Include = /etc/pacman.d/mirrorlist [community] diff --git a/setarch-aliases.d/pentium4 b/setarch-aliases.d/pentium4 new file mode 100644 index 0000000..193dd70 --- /dev/null +++ b/setarch-aliases.d/pentium4 @@ -0,0 +1 @@ +i686 |