summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Severance2018-09-04 15:45:57 -0400
committerChris Severance2018-09-04 15:45:57 -0400
commit018abbf0eca7c9bf7e5b0efb3b1a289374975a1c (patch)
tree726ae0ff619fd0db956ecb78156abf93abcb48fa
parentc5c29535f7b8650319ac77d5cf441d498ccef0b8 (diff)
downloadaur-018abbf0eca7c9bf7e5b0efb3b1a289374975a1c.tar.gz
autu: Update to 3.60-1 Improve make scripts from spec
-rw-r--r--.SRCINFO2
-rw-r--r--PKGBUILD56
2 files changed, 41 insertions, 17 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 4eef39caf65..4f04a916abc 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,5 +1,5 @@
# Generated by mksrcinfo v8
-# Wed Aug 29 22:31:45 UTC 2018
+# Tue Sep 4 19:45:56 UTC 2018
pkgbase = cndrvcups-lb
pkgdesc = CUPS Canon UFR II LIPSLX CARPS2 printer driver for LBP iR MF ImageCLASS ImageRUNNER Laser Shot i-SENSYS ImagePRESS ADVANCE printers and copiers
pkgver = 3.60
diff --git a/PKGBUILD b/PKGBUILD
index 26b5855396f..e50ea85dc0d 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -41,12 +41,43 @@ sha256sums=('a5bf2c2d53049ad64acf2ed8b6dc954ff261c4b996ce1cc81471e5baaf5e40cd'
sha512sums=('c8b2abb2d0e9ccf972241dda5154c0ddd1ba9cfe6c721c242c40c90cf29e8d0b2c6a559907318cd191232f699a42425cc4148aebcaab6aa111f1cb5439777ce7'
'736e1785c443c4d129c8801a127410012889f46691259e8a7f6a54106a0647beb5b6267aabb78b3ed0a1c7a9d8ce216e159515d3aad425812e5be52c8b58e4ee')
-# build instructions are adapted from upstream file
-# cndrvcups-lb.spec
-
prepare() {
set -u
bsdtar -xf "linux-UFRII-drv-v${_pkgver//\./}-uken/Sources/${_srcdir}-1.tar.gz"
+
+ cd "${_srcdir}"
+
+ local _specs=(cndrvcups-*.spec)
+ if [ "${#_specs[@]}" -ne 1 ]; then
+ echo 'Too many or too few spec files'
+ set +u
+ false
+ fi
+
+ # allgen.sh where available is not useful for packaging
+ # Debian rules has some undesirable functionality
+ # The spec file packages well and is easy to fix and convert to shell
+
+ # Generate make from spec %setup, %build
+ sed -n -e '/^%setup/,/^%install/ p' "${_specs[@]}" | \
+ grep -v '^%' | \
+ sed -e '# Convert spec %{VAR} to shell ${VAR}' \
+ -e 's:%{:${:g' \
+ -e '# Add autoreconf before autogen lines' \
+ -e '# Some autogen left out --prefix. More than one --prefix dont cause problems so we can add it to all of them.' \
+ -e 's:^./autogen.sh\b:autoreconf -fi\n& --prefix=${_prefix}:g ' \
+ > 'make.Arch'
+
+ # Generate make install from spec %install
+ sed -n -e '/^%install/,/^%clean/ p' "${_specs[@]}" | \
+ grep -v '^%' | \
+ sed -e '# Convert spec %{VAR} to shell ${VAR}' \
+ -e 's:%{:${:g' \
+ -e '# Quote to handle path with spaces' \
+ -e 's:${RPM_BUILD_ROOT}:"&":g' \
+ -e '# ln -f hides problems so should be avoided' \
+ -e 's:ln -sf :ln -s :g' \
+ > 'make.install.Arch'
set +u
}
@@ -67,12 +98,9 @@ build() {
cd "${_srcdir}"
local _vars; _setvars
- sed -n -e '/^%setup/,/^%install/ p' cndrvcups-*.spec | \
- grep -v '^%' | \
- sed -e 's:%{:${:g' \
- -e 's:^./autogen.sh\b:autoreconf -fi\n& --prefix=${_prefix}:g ' \
- | env "${_vars[@]}" \
- sh -e -u -x --
+ # Bash does not recognize var assigments hidden by array expansion so we use env.
+ env "${_vars[@]}" \
+ sh -e -u -x 'make.Arch'
set +u
}
@@ -83,13 +111,9 @@ package() {
cd "${_srcdir}"
local _vars; _setvars
- sed -n -e '/^%install/,/^%clean/ p' cndrvcups-*.spec | \
- grep -v '^%' | \
- sed -e 's:%{:${:g' \
- -e 's:${RPM_BUILD_ROOT}:"&":g' \
- | env RPM_BUILD_ROOT="${pkgdir}" \
- "${_vars[@]}" \
- sh -e -u -x --
+ env "${_vars[@]}" \
+ RPM_BUILD_ROOT="${pkgdir}" \
+ sh -e -u -x 'make.install.Arch'
_fin