Commit 9e3a8f02 authored by AlmAck's avatar AlmAck

pacman 5.1.2

introduced pacman-contrib taht contains some additional scripts like updpkgsums
parent 12fb938e
Pipeline #2558 passed with stages
in 1 minute and 52 seconds
pkgname=pacman-contrib
pkgver=1.1.0
pkgrel=1
pkgdesc="Contributed scripts and tools for pacman systems"
url="https://git.archlinux.org/pacman-contrib.git/about/"
arch=('x86_64')
license=('GPL')
depends=('pacman' 'fakeroot')
optdepends=('mlocate: pacdiff'
'findutils: pacdiff')
makedepends=('asciidoc')
validpgpkeys=('5134EF9EAF65F95B6BB1608E50FB9B273A9D0BB5') # Johannes Löthberg <johannes@kyriasis.com>
source=(https://sources.archlinux.org/other/community/pacman-contrib/pacman-contrib-$pkgver.tar.gz{,.asc})
sha256sums=('308c3b8dc15ed8bd419cba1eb3103afe9250cf415626334a0c3a753b550549a6'
'SKIP')
build() {
cd pacman-contrib-$pkgver
./configure \
--prefix=/usr \
--sysconfdir=/etc \
--localstatedir=/var
make
}
check() {
make -C pacman-contrib-$pkgver check
}
package() {
cd pacman-contrib-$pkgver
make DESTDIR="$pkgdir" install
}
pkgname=pacman
pkgver=5.0.2
pkgrel=2
pkgver=5.1.2
pkgrel=1
pkgdesc="A library-based package manager with dependency support"
arch=('x86_64')
url="http://www.archlinux.org/pacman/"
license=('GPL')
groups=('base' 'base-devel')
depends=('bash>=4.3.025-1' 'glibc>=2.20-2' 'libarchive=3.2.2' 'curl>=7.28.1'
'gpgme' 'pacman-mirrorlist' 'nettle>=3.1')
depends=('bash' 'glibc' 'libarchive' 'curl'
'gpgme' 'pacman-mirrorlist')
checkdepends=('python2' 'fakechroot')
makedepends=('asciidoc')
optdepends=('fakeroot: for makepkg usage as normal user')
backup=(etc/pacman.conf etc/makepkg.conf)
install=pacman.install
options=(!libtool)
optdepends=('perl-locale-gettext: translation support in makepkg-template'
'xdelta3: delta support in repo-add')
backup=(etc/pacman.conf
etc/makepkg.conf)
options=('strip')
source=(https://sources.archlinux.org/other/pacman/$pkgname-$pkgver.tar.gz{,.sig}
https://git.archlinux.org/svntogit/packages.git/plain/trunk/0001-libmakepkg-Support-file-5.33-s-application-x-pie-exe.patch?h=packages/pacman
pacman.conf
makepkg.conf)
sha1sums=('3b9c0797ac04a89d1517771595f13bddc68933b1'
'SKIP'
'6e760dbfc5b05ac9fb6bcc80e553c4c08fbf59e2'
'735dfdbf78f1249567b3250a2766f55eb6ae9a0c'
'0e61e106d58a332ac7bb0a34885358d37297886e')
md5sums=('68d559a8f64efce9840efa7c87fc52a3'
'SKIP'
'40a92b2788ac997e44dd9b54406e9e18'
'9dc831e27cafae4bff3a41a06001ae18')
validpgpkeys=('6645B0A8C7005E78DB1D7864F99FFE0FEAE999BD' # Allan McRae <allan@archlinux.org>
'B8151B117037781095514CA7BBDFFC92306B1121') # Andrew Gregory (pacman) <andrew@archlinux.org>
......@@ -41,14 +40,13 @@ prepare() {
}
build() {
cd "$srcdir"/$pkgname-$pkgver
cd $pkgname-$pkgver
./configure --prefix=/usr --sysconfdir=/etc \
--localstatedir=/var --enable-doc \
--with-scriptlet-shell=/usr/bin/bash \
--with-ldconfig=/usr/bin/ldconfig
make V=1
make -C contrib
}
check() {
......@@ -56,33 +54,20 @@ check() {
}
package() {
cd "$srcdir"/$pkgname-$pkgver
cd $pkgname-$pkgver
make DESTDIR="$pkgdir" install
make DESTDIR="$pkgdir" -C contrib install
# install Chakra specific stuff
install -Dm644 "$srcdir"/pacman.conf "$pkgdir"/etc/pacman.conf
mycarch="x86_64"
mychost="x86_64-pc-linux-gnu"
myflags="-march=x86-64"
install -Dm644 "$srcdir"/makepkg.conf "$pkgdir"/etc/makepkg.conf
# set things correctly in the default conf file
sed -i "$pkgdir"/etc/makepkg.conf \
-e "s|@CARCH[@]|$mycarch|g" \
-e "s|@CHOST[@]|$mychost|g" \
-e "s|@CARCHFLAGS[@]|$myflags|g"
install -m644 "$srcdir/pacman.conf" "$pkgdir/etc"
install -m644 "$srcdir/makepkg.conf" "$pkgdir/etc"
# put bash_completion in the right location
install -dm755 ${pkgdir}/usr/share/bash-completion/completions
mv ${pkgdir}/etc/bash_completion.d/pacman \
${pkgdir}/usr/share/bash-completion/completions
rmdir ${pkgdir}/etc/bash_completion.d
install -dm755 "$pkgdir/usr/share/bash-completion/completions"
mv "$pkgdir/etc/bash_completion.d/pacman" "$pkgdir/usr/share/bash-completion/completions"
rmdir "$pkgdir/etc/bash_completion.d"
for f in makepkg pacman-key; do
ln -s pacman "$pkgdir"/usr/share/bash-completion/completions/$f
ln -s pacman "$pkgdir/usr/share/bash-completion/completions/$f"
done
install -Dm644 contrib/PKGBUILD.vim "$pkgdir"/usr/share/vim/vimfiles/syntax/PKGBUILD.vim
}
......@@ -8,9 +8,10 @@
#
#-- The download utilities that makepkg should use to acquire sources
# Format: 'protocol::agent'
DLAGENTS=('ftp::/usr/bin/curl -fC - --ftp-pasv --retry 3 --retry-delay 3 -o %o %u'
'http::/usr/bin/curl -fLC - --retry 3 --retry-delay 3 -o %o %u'
'https::/usr/bin/curl -fLC - --retry 3 --retry-delay 3 -o %o %u'
DLAGENTS=('file::/usr/bin/curl -gqC - -o %o %u'
'ftp::/usr/bin/curl -gqfC - --ftp-pasv --retry 3 --retry-delay 3 -o %o %u'
'http::/usr/bin/curl -gqb "" -fLC - --retry 3 --retry-delay 3 -o %o %u'
'https::/usr/bin/curl -gqb "" -fLC - --retry 3 --retry-delay 3 -o %o %u'
'rsync::/usr/bin/rsync --no-motd -z %u %o'
'scp::/usr/bin/scp -C %u %o')
......@@ -30,15 +31,13 @@ VCSCLIENTS=('bzr::bzr'
# ARCHITECTURE, COMPILE FLAGS
#########################################################################
#
CARCH="@CARCH@"
CHOST="@CHOST@"
CARCH="x86_64"
CHOST="x86_64-pc-linux-gnu"
#-- Compiler and Linker Flags
# -march (or -mcpu) builds exclusively for an architecture
# -mtune optimizes for an architecture, but builds for whole processor family
CPPFLAGS="-D_FORTIFY_SOURCE=2"
CFLAGS="@CARCHFLAGS@ -mtune=generic -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4"
CXXFLAGS="@CARCHFLAGS@ -mtune=generic -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4"
CFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4"
CXXFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4"
LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro"
#-- Make Flags: change this for DistCC/SMP systems
#MAKEFLAGS="-j2"
......@@ -73,7 +72,7 @@ BUILDENV=(!distcc color !ccache check !sign)
# These are default values for the options=() settings
#########################################################################
#
# Default: OPTIONS=(strip docs !libtool !staticlibs emptydirs zipman purge !optipng !upx !debug)
# Default: OPTIONS=(strip docs !libtool !staticlibs emptydirs zipman purge !debug)
# A negated option will do the opposite of the comments below.
#
#-- strip: Strip symbols from binaries/libraries
......@@ -83,11 +82,9 @@ BUILDENV=(!distcc color !ccache check !sign)
#-- emptydirs: Leave empty directories in packages
#-- zipman: Compress manual (man and info) pages in MAN_DIRS with gzip
#-- purge: Remove files specified by PURGE_TARGETS
#-- upx: Compress binary executable files using UPX
#-- optipng: Optimize PNG images with optipng
#-- debug: Add debugging flags as specified in DEBUG_* variables
#
OPTIONS=(strip docs !libtool !staticlibs emptydirs zipman purge !upx !debug)
OPTIONS=(strip docs !libtool !staticlibs emptydirs zipman purge !debug)
#-- File integrity checks to use. Valid: md5, sha1, sha256, sha384, sha512
INTEGRITY_CHECK=(md5)
......@@ -103,6 +100,8 @@ MAN_DIRS=({usr{,/local}{,/share},opt/*}/{man,info})
DOC_DIRS=(usr/{,local/}{,share/}{doc,gtk-doc} opt/*/{doc,gtk-doc})
#-- Files to be removed from all packages (if purge is specified)
PURGE_TARGETS=(usr/{,share}/info/dir .packlist *.pod)
#-- Directory to store source code in for debug packages
DBGSRCDIR="/usr/src/debug"
#########################################################################
# PACKAGE OUTPUT
......
#!/bin/sh
# arg 1: the new package version
# arg 2: the old package version
post_upgrade() {
# one time stuff for md5sum issue with older pacman versions
if [ "$(vercmp $2 3.0.2)" -lt 0 ]; then
_resetbackups
fi
if [ "$(vercmp $2 3.5.0)" -lt 0 ]; then
_warnupgrade
fi
}
_warnupgrade() {
echo ">>> The pacman database format has changed as of pacman 3.5.0."
echo ">>> You will need to run \`pacman-db-upgrade\` as root."
echo ">>>"
}
_resetbackups() {
echo ">>> Performing one-time reset of NoUpgrade md5sums. After this reset"
echo ">>> you are able to remove all NoUpgrade lines of already protected"
echo ">>> files from pacman.conf."
echo ">>>"
# path variables
pacconf="/etc/pacman.conf"
dbpath="/var/lib/pacman/local"
# get a list of NoUpgrade files from the user's pacman.conf
echo ">>> Retrieving pacman.conf NoUpgrade list..."
config=$(grep "^NoUpgrade" $pacconf | cut -d'=' -f2)
# add the standard list of files, even if they are already above
config="$config \
etc/passwd etc/group etc/shadow etc/sudoers \
etc/fstab etc/raidtab etc/ld.so.conf \
etc/rc.conf etc/rc.local \
etc/modprobe.conf etc/modules.conf \
etc/lilo.conf boot/grub/menu.lst"
# blank md5sum for use in sed expression
zeroes='00000000000000000000000000000000'
for file in $config; do
echo ">>> -> finding owner of /$file..."
line=$(LC_ALL=C LANG=C pacman -Qo /$file 2>/dev/null)
# if file is owned by a package, go find its incorrectly stored sum
if [ ! -z "$line" ]; then
# get the name and version of the package owning file
name=$(echo $line | awk '{print $5}')
version=$(echo $line | awk '{print $6}')
# set the path to the backup array holding the md5sum
path="$dbpath/$name-$version/files"
# run a sed on the path to reset the line containing $file
# NOTE: literal tab characters in sed expression after $file
echo ">>> -> resetting sum of /$file..."
sed -i "s#$file [0-9a-fA-F]*#$file $zeroes#" $path
else
echo ">>> -> $file is unowned."
fi
done
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment