git » mariadb.git » commit 39a642a

clean up installation

author Christian Hesse
2022-10-07 09:55:11 UTC
committer Christian Hesse
2022-10-07 09:55:11 UTC
parent b0a86b23937774a231b540ac33e953e159137e29

clean up installation

PKGBUILD +19 -18

diff --git a/PKGBUILD b/PKGBUILD
index 5fbee15..e28fd2d 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -116,20 +116,21 @@ package_mariadb-libs() {
     make -C "$dir" DESTDIR="$pkgdir" install
   done
 
+  # remove static libraries
+  rm "${pkgdir}"/usr/lib/*.a
+
+  # remove man pages
+  rm -r "${pkgdir}"/usr/share/man
+  
   ln -s mariadb_config "$pkgdir"/usr/bin/mariadb-config
   ln -s mariadb_config "$pkgdir"/usr/bin/mysql_config
   install -D -m0644 "$srcdir"/"$pkgbase-$pkgver"/man/mysql_config.1 "$pkgdir"/usr/share/man/man1/mysql_config.1
+  ln -s mysql_config.1 "$pkgdir"/usr/share/man/man1/mariadb_config.1
+  ln -s mysql_config.1 "$pkgdir"/usr/share/man/man1/mariadb-config.1
 
   install -D -m0644 support-files/mariadb.pc "$pkgdir"/usr/share/pkgconfig/mariadb.pc
   install -D -m0644 "$srcdir"/"$pkgbase-$pkgver"/support-files/mysql.m4 "$pkgdir"/usr/share/aclocal/mysql.m4
 
-  cd "$pkgdir"
-
-  # remove static libraries
-  rm usr/lib/*.a
-
-  # remove man pages
-  rm -r usr/share/man
 }
 
 package_mariadb-clients() {
@@ -138,14 +139,14 @@ package_mariadb-clients() {
   conflicts=('mysql-clients')
   provides=("mysql-clients=$pkgver")
 
-  cd build
-
-  make -C client DESTDIR="$pkgdir" install
-
+  make -C build/client DESTDIR="${pkgdir}" install
+  
   # install man pages
-  for man in mysql mysql_plugin mysql_upgrade mysqladmin mysqlbinlog mysqlcheck mysqldump mysqlimport mysqlshow mysqlslap mysqltest; do
-    install -D -m0644 "$srcdir"/"$pkgbase-$pkgver"/man/"$man.1" "$pkgdir"/usr/share/man/man1/"$man.1"
-  done
+  make -C build/man DESTDIR="${srcdir}"/client-man install
+  install -d -m0755 "${pkgdir}"/usr/share/man/man1/
+  for man in $(find "${pkgdir}"/usr/bin/ ! -type d); do
+    install -D -m0644 -t "${pkgdir}"/usr/share/man/man1/ "${srcdir}"/client-man/usr/share/man/man1/"$(basename "${man}")".1
+  done    
 }
 
 package_mariadb() {
@@ -204,16 +205,16 @@ package_mariadb() {
   # provided by mariadb-libs
   rm usr/bin/{mariadb{_,-},mysql_}config
   rm -r usr/include/
-  rm usr/share/man/man1/mysql_config.1
+  rm usr/share/man/man1/{mariadb,mysql}_config.1
   rm -r usr/share/aclocal
   rm usr/lib/lib*
   rm -r usr/lib/pkgconfig
   rm usr/lib/mysql/plugin/{auth_gssapi_client,caching_sha2_password,client_ed25519,dialog,mysql_clear_password,sha256_password,zstd}.so
 
   # provided by mariadb-clients
-  rm usr/bin/mysql{,_plugin,_upgrade,admin,binlog,check,dump,import,show,slap,test}
-  rm usr/bin/mariadb{,-{admin,binlog,check,conv,dump,import,plugin,show,slap,test,upgrade}}
-  rm usr/share/man/man1/mysql{,_plugin,_upgrade,admin,binlog,check,dump,import,show,slap,test}.1
+  for bin in $(find "${pkgdir}"/../mariadb-clients/usr/bin/ ! -type d); do
+    rm "${pkgdir}"/usr/bin/"$(basename "${bin}")" "${pkgdir}"/usr/share/man/man1/"$(basename "${bin}")".1
+  done
 
   # provided by mytop
   rm usr/bin/mytop