Compare commits

...

30 Commits
3.0 ... master

Author SHA1 Message Date
helixarch
0c4f92b12e
Merge pull request #93 from SnivySquid65/master
Added choice in updating when given the "run debtap -u" prompt.
2025-03-06 00:12:23 +02:00
SnivySquid65
795ad62414 patch for teh pull request 2025-03-05 22:04:21 +00:00
helixarch
99991fa9c9
Add files via upload 2022-04-25 10:45:43 +03:00
helixarch
4a94689739
Add files via upload 2022-04-25 07:33:55 +03:00
helixarch
a72e9f1335
Merge pull request #73 from pkasemir/add-zstd-support
Add tar zstd support
2022-04-21 21:30:39 +03:00
Paul Kasemir
7bb6814d35 Add tar zstd support 2022-04-01 17:02:53 -06:00
helixarch
02d3b9f8fd
Update debtap 2021-04-09 10:35:19 +03:00
helixarch
b69cb86bba
Add files via upload 2021-01-15 16:52:12 +02:00
helixarch
e113d8d3df
Add files via upload 2021-01-15 16:50:42 +02:00
helixarch
44aff8c10d
Add files via upload 2020-07-29 18:20:39 +03:00
helixarch
dd82b9675d
Add files via upload 2020-07-29 18:19:18 +03:00
helixarch
ea0f2fe475
Add files via upload 2020-07-29 18:13:54 +03:00
helixarch
76d68c254a
Add files via upload 2020-06-25 15:24:58 +03:00
helixarch
1cb0669745
Add files via upload 2020-06-25 15:18:24 +03:00
helixarch
7ce761c91e
Add files via upload 2020-06-25 14:55:35 +03:00
helixarch
c2dd400484
Merge pull request #50 from juergenhoetzel/master
packager_name: Use makepkg.conf settings as default value
2020-06-25 14:53:28 +03:00
Juergen Hoetzel
e3f16487f1 packager_name: Use makepkg.conf settings as default value 2020-06-04 21:16:52 +02:00
helixarch
9938f2b945
Add files via upload 2020-04-25 21:55:37 +03:00
helixarch
78d28f5abb
Add files via upload 2020-04-25 21:54:51 +03:00
helixarch
93382a0e8a
Merge pull request #48 from BrunoChevalier/master
Fix small typos in output
2020-04-24 13:50:09 +03:00
Bruno Chevalier
a1cbb3c6f0 Fix small typos in output 2020-04-24 09:59:14 +02:00
helixarch
946a8572f2
Update 3.2.2
Update 3.2.2
2018-04-23 20:51:00 +03:00
helixarch
8b1be79086
Update 3.2.1
Update 3.2.1
2018-04-22 21:36:55 +03:00
helixarch
4d1ea9424f
Update README.md 2018-04-22 19:55:09 +03:00
helixarch
c63bd833ad
Update 3.2
Update 3.2
2018-04-22 19:49:30 +03:00
helixarch
e16dde15ad Update 3.1.4 2017-08-21 19:03:03 +03:00
helixarch
e5f3228cca Update 3.1.3 2017-08-21 16:40:28 +03:00
helixarch
b1049270c2 Update 3.1.2 2017-08-21 14:57:31 +03:00
helixarch
aa104d7971 Update 3.1.1 2017-08-16 07:30:31 +03:00
helixarch
d93bab1341 Update 3.1 2017-08-16 07:13:17 +03:00
2 changed files with 216 additions and 211 deletions

View File

@ -39,11 +39,12 @@ Any recommendations or questions for debtap are welcomed!
Available options:
==================
-h --h -help --help Prints help
-u --u -update --update Update debtap database
-q --q -quiet --quiet Bypass all questions, except for editing metadata file(s)
-Q --Q -Quiet --Quiet Bypass all questions (not recommended)
-s --s -pseudo --pseudo Create a pseudo-64-bit package from a 32-bit .deb package
-w --w -wipeout --wipeout Wipeout versions from all dependencies, conflicts etc.
-p --p -pkgbuild --pkgbuild Additionally generate a PKGBUILD file
-P --P -Pkgbuild --Pkgbuild Generate a PKGBUILD file only
-h --help Prints help
-u --update Update debtap database
-q --quiet Bypass all questions, except for editing metadata file(s)
-Q --Quiet Bypass all questions (not recommended)
-s --pseudo Create a pseudo-64-bit package from a 32-bit .deb package
-w --wipeout Wipeout versions from all dependencies, conflicts etc.
-p --pkgbuild Additionally generate a PKGBUILD file
-P --Pkgbuild Generate a PKGBUILD file only
-v --version     Print version

410
debtap
View File

@ -1,6 +1,6 @@
#!/usr/bin/bash
# Copyright 2014-2017 George Savvidis
# Copyright 2014-2022 George Savvidis
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -15,6 +15,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
Version=3.5.1
# Defining colors and bold letters
lightgreen='\e[1;32m'
lightred='\e[1;31m'
@ -26,36 +28,41 @@ normal=`tput sgr0`
# Options, help, database update and error messages
for i in "$@"; do
if [[ "$i" =~ ^-(-)?([huqQswpP]*)h([huqQswpP]*)$ ]] || [[ "$i" =~ ^-(-)?help$ ]]; then
if [[ "$i" =~ ^-([huqQswpPv]*)h([huqQswpPv]*)$ ]] || [[ "$i" =~ ^--help$ ]]; then
help=set
fi
if [[ "$i" =~ ^-(-)?([huqQswpP]*)u([huqQswpP]*)$ ]] || [[ "$i" =~ ^-(-)?update$ ]]; then
if [[ "$i" =~ ^-([huqQswpPv]*)u([huqQswpPv]*)$ ]] || [[ "$i" =~ ^--update$ ]]; then
update=set
fi
if [[ "$i" =~ ^-(-)?([huqQswpP]*)q([huqQswpP]*)$ ]] || [[ "$i" =~ ^-(-)?quiet$ ]]; then
if [[ "$i" =~ ^-([huqQswpPv]*)q([huqQswpPv]*)$ ]] || [[ "$i" =~ ^--quiet$ ]]; then
quiet=set
fi
if [[ "$i" =~ ^-(-)?([huqQswpP]*)Q([huqQswpP]*)$ ]] || [[ "$i" =~ ^-(-)?Quiet$ ]]; then
if [[ "$i" =~ ^-([huqQswpPv]*)Q([huqQswpPv]*)$ ]] || [[ "$i" =~ ^--Quiet$ ]]; then
Quiet=set
fi
if [[ "$i" =~ ^-(-)?([huqQswpP]*)s([huqQswpP]*)$ ]] || [[ "$i" =~ ^-(-)?pseudo$ ]]; then
if [[ "$i" =~ ^-([huqQswpPv]*)s([huqQswpPv]*)$ ]] || [[ "$i" =~ ^--pseudo$ ]]; then
pseudo=set
fi
if [[ "$i" =~ ^-(-)?([huqQswpP]*)w([huqQswpP]*)$ ]] || [[ "$i" =~ ^-(-)?wipeout$ ]]; then
if [[ "$i" =~ ^-([huqQswpPv]*)w([huqQswpPv]*)$ ]] || [[ "$i" =~ ^--wipeout$ ]]; then
wipeout=set
fi
if [[ "$i" =~ ^-(-)?([huqQswpP]*)p([huqQswpP]*)$ ]] || [[ "$i" =~ ^-(-)?pkgbuild$ ]]; then
if [[ "$i" =~ ^-([huqQswpPv]*)p([huqQswpPv]*)$ ]] || [[ "$i" =~ ^--pkgbuild$ ]]; then
pkgbuild=set
fi
if [[ "$i" =~ ^-(-)?([huqQswpP]*)P([huqQswpP]*)$ ]] || [[ "$i" =~ ^-(-)?Pkgbuild$ ]]; then
if [[ "$i" =~ ^-([huqQswpPv]*)P([huqQswpPv]*)$ ]] || [[ "$i" =~ ^--Pkgbuild$ ]]; then
Pkgbuild=set
fi
if [[ "$i" =~ ^-([huqQswpPv]*)v([huqQswpPv]*)$ ]] || [[ "$i" =~ ^--version$ ]]; then
version=set
fi
done
if [[ $pseudo == set ]] && [[ ! -e /var/lib/pacman/sync/multilib.db ]] && [[ ! -e /var/lib/pacman/sync/multilib-testing.db ]]; then
echo -e "${red}Error: You are either running non-x86_64 Arch Linux, or you haven't enabled multilib repository. If you are running x86_64 Arch Linux, you must enable a multilib repository and then synchronize pacman database${NC}"; exit 1
fi
if [[ $help == set ]]; then
echo -e "Syntax: debtap [options] package_filename\n\nOptions:\n\n -h --h -help --help Prints this help message\n -u --u -update --update Update debtap database\n -q --q -quiet --quiet Bypass all questions, except for editing metadata file(s)\n -Q --Q -Quiet --Quiet Bypass all questions (not recommended)\n -s --s -pseudo --pseudo Create a pseudo-64-bit package from a 32-bit .deb package\n -w --w -wipeout --wipeout Wipeout versions from all dependencies, conflicts etc.\n -p --p -pkgbuild --pkgbuild Additionally generate a PKGBUILD file\n -P --P -Pkgbuild --Pkgbuild Generate a PKGBUILD file only"; exit 0
echo -e "Syntax: debtap [options] package_filename\n\nOptions:\n\n -h --help Print this help message\n -u --update Update debtap database\n -q --quiet Bypass all questions, except for editing metadata file(s)\n -Q --Quiet Bypass all questions (not recommended)\n -s --pseudo Create a pseudo-64-bit package from a 32-bit .deb package\n -w --wipeout Wipeout versions from all dependencies, conflicts etc.\n -p --pkgbuild Additionally generate a PKGBUILD file\n -P --Pkgbuild Generate a PKGBUILD file only\n -v --version Print version"; exit 0
elif [[ $version == set ]]; then
echo -e "$Version"; exit 0
elif [[ $update == set ]]; then
if [[ $EUID != 0 ]]; then
echo -e "${red}Error: You must run this command with root privileges${NC}"; exit 1
@ -68,25 +75,31 @@ elif [[ $update == set ]]; then
echo -e "${red}Synchronization failed. Exiting...${NC}"; exit 1
else
echo -e "${lightgreen}==>${NC} ${bold}Synchronizing debtap database...${normal}"
if [[ "$(uname -m)" == "i686" ]]; then
_arch=i386
elif [[ "$(uname -m)" == "x86_64" ]]; then
if [[ "$(uname -m)" == "i686" ]] || [[ "$(uname -m)" == "x86_64" ]]; then
_arch=amd64
elif [[ "$(uname -m)" == "armv7l" ]] || [[ "$(uname -m)" == "armv7h" ]]; then
_arch=armhf
elif [[ "$(uname -m)" == "aarch64" ]]; then
_arch=arm64
fi
ubuntu_latest_stable_version=`curl -s https://packages.ubuntu.com | grep option | gawk -F '=' '{print $2}' | gawk '{print $1}' | grep -v option | tac | sed -n 3'{p;q;}' | sed s'/\("\|-updated\|-backports\)//g'`
curl -C - -f http://ftp.debian.org/debian/dists/sid/main/Contents-$_arch.gz > /var/cache/debtap/debian-packages-files.gz
gzip -df /var/cache/debtap/debian-packages-files.gz
curl -C - -f http://archive.ubuntu.com/ubuntu/dists/$ubuntu_latest_stable_version/Contents-$_arch.gz > /var/cache/debtap/ubuntu-packages-files.gz
ubuntu_latest_stable_version=`curl -k -s https://packages.ubuntu.com | grep option | gawk -F '=' '{print $2}' | gawk '{print $1}' | grep -v option | tac | sed -n 3'{p;q;}' | sed s'/\("\|-updated\|-backports\)//g'`
curl -k -C - -f http://ftp.debian.org/debian/dists/sid/main/Contents-$_arch.gz > /var/cache/debtap/debian-main-packages-files.gz
gzip -df /var/cache/debtap/debian-main-packages-files.gz
curl -k -C - -f http://ftp.debian.org/debian/dists/sid/non-free/Contents-$_arch.gz > /var/cache/debtap/debian-non-free-packages-files.gz
gzip -df /var/cache/debtap/debian-non-free-packages-files.gz
curl -k -C - -f http://ftp.debian.org/debian/dists/sid/contrib/Contents-$_arch.gz > /var/cache/debtap/debian-contrib-packages-files.gz
gzip -df /var/cache/debtap/debian-contrib-packages-files.gz
if [[ $_arch == amd64 ]]; then
curl -k -C - -f http://archive.ubuntu.com/ubuntu/dists/$ubuntu_latest_stable_version/Contents-$_arch.gz > /var/cache/debtap/ubuntu-packages-files.gz
else
curl -k -C - -f http://ports.ubuntu.com/ubuntu-ports/dists/$ubuntu_latest_stable_version/Contents-$_arch.gz > /var/cache/debtap/ubuntu-packages-files.gz
fi
gzip -df /var/cache/debtap/ubuntu-packages-files.gz
if [[ $(echo $?) != 0 ]]; then
echo -e "${red}Synchronization failed. Exiting...${NC}"; exit 1
else
echo -e "${lightgreen}==>${NC} ${bold}Downloading latest virtual packages list...${normal}"
curl -L https://github.com/helixarch/virtual-packages-list-generator/archive/master.tar.gz > /var/cache/debtap/master.tar.gz
curl -k -L https://github.com/helixarch/virtual-packages-list-generator/archive/master.tar.gz > /var/cache/debtap/master.tar.gz
tar xfz /var/cache/debtap/master.tar.gz -C /var/cache/debtap
mv /var/cache/debtap/virtual-packages-list-generator-master/virtual-packages /var/cache/debtap
rm -rf /var/cache/debtap/master.tar.gz /var/cache/debtap/virtual-packages-list-generator-master
@ -94,13 +107,14 @@ elif [[ $update == set ]]; then
echo -e "${red}Downloading failed. Exiting...${NC}"; exit 1
else
echo -e "${lightgreen}==>${NC} ${bold}Downloading latest AUR packages list...${normal}"
curl -C - -f https://aur.archlinux.org/packages.gz > /var/cache/debtap/aur-packages.gz
curl -k -C - -f https://aur.archlinux.org/packages.gz > /var/cache/debtap/aur-packages.gz
gzip -df /var/cache/debtap/aur-packages.gz
if [[ $(echo $?) != 0 ]]; then
echo -e "${red}Downloading failed. Exiting...${NC}"; exit 1
else
echo -e "${lightgreen}==>${NC} ${bold}Generating base group packages list...${normal}"
pacman -Qqg base > /var/cache/debtap/base-packages
echo -e "${lightgreen}==>${NC} ${bold}Generating base group packages list...${normal}"
rm -rf /var/cache/debtap/base-packages
for i in $(pacman -Qi base 2> /dev/null | grep ^Depends | cut -d: -f2); do echo "$i" >> /var/cache/debtap/base-packages; done; echo >> /var/cache/debtap/base-packages
chmod 644 /var/cache/debtap/*
echo -e "${lightgreen}==>${NC} ${bold}All steps successfully completed!${normal}"; exit 0
fi
@ -108,25 +122,58 @@ elif [[ $update == set ]]; then
fi
fi
fi
elif [[ "${@: -1}" == "debtap" ]] || [[ "${@: -1}" =~ /debtap$ ]] || [[ "${@: -1}" =~ ^-(-)?([qQswpP]+)$ ]] || [[ "${@: -1}" =~ ^-(-)?([quiet|Quiet|pseudo|wipeout|pkgbuild|Pkgbuild]){1,}$ ]]; then
echo -e "${red}Error: You haven't specified a deb package${NC}\nSyntax: debtap [options] package_filename\n\nOptions:\n\n -h --h -help --help Prints this help message\n -u --u -update --update Update debtap database\n -q --q -quiet --quiet Bypass all questions, except for editing metadata file(s)\n -Q --Q -Quiet --Quiet Bypass all questions (not recommended)\n -s --s -pseudo --pseudo Create a pseudo-64-bit package from a 32-bit .deb package\n -w --w -wipeout --wipeout Wipeout versions from all dependencies, conflicts etc.\n -p --p -pkgbuild --pkgbuild Additionally generate a PKGBUILD file\n -P --P -Pkgbuild --Pkgbuild Generate a PKGBUILD file only"; exit 1
elif [[ "${@: -1}" == "debtap" ]] || [[ "${@: -1}" =~ /debtap$ ]] || [[ "${@: -1}" =~ ^-([qQswpP]+)$ ]] || [[ "${@: -1}" =~ ^--([quiet|Quiet|pseudo|wipeout|pkgbuild|Pkgbuild]){1,}$ ]]; then
echo -e "${red}Error: You haven't specified a deb package${NC}\nSyntax: debtap [options] package_filename\n\nOptions:\n\n -h --help Print this help message\n -u --update Update debtap database\n -q --quiet Bypass all questions, except for editing metadata file(s)\n -Q --Quiet Bypass all questions (not recommended)\n -s --pseudo Create a pseudo-64-bit package from a 32-bit .deb package\n -w --wipeout Wipeout versions from all dependencies, conflicts etc.\n -p --pkgbuild Additionally generate a PKGBUILD file\n -P --Pkgbuild Generate a PKGBUILD file only\n -v --version Print version"; exit 1
elif [[ "${@: -1}" =~ ^(-)+(.)*$ ]] || [[ $(ls "${@: -1}" &> /dev/null; echo $?) != 0 ]]; then
echo -e "${red}Error: No such file or directory or invalid option${NC}"; exit 1
elif [[ $(file -b "${@: -1}" | grep -q "Debian binary package"; echo $?) != 0 ]]; then
elif [[ $(file -S -b "${@: -1}" | grep -q "Debian binary package"; echo $?) != 0 ]]; then
echo -e "${red}Error: You haven't specified a valid deb package${NC}"; exit 1
fi
if [[ ! $(ls /var/cache/pkgfile/*.files 2> /dev/null) ]] || [[ ! $(ls /var/cache/debtap/*-packages-files 2> /dev/null) ]] || [[ ! -e /var/cache/debtap/base-packages ]] || [[ ! -e /var/cache/debtap/aur-packages ]] || [[ ! -e /var/cache/debtap/virtual-packages ]]; then
# This should fix it. Patch by SnivySquid65!
if [[ $pseudo != set ]]; then
echo -e "${red}Error: You must run at least once \"debtap -u\" with root privileges (preferably recently), before running this script${NC}"; exit 1
while true; do
read -p "Updates may be available that are not installed! Proceed anyway? (If you've already ran 'debtap -u' recently, you can ignore this and continue.) (y/n) " yn
case $yn in
[yY] ) echo "Then let's continue!";
break;;
[nN] ) echo "Aborted!!";
exit;;
* ) echo "Invalid input.";;
esac
done
else
echo -e "${red}Error: You must enable a multilib repository, synchronize pacman database and then run at least once \"debtap -u\" with root privileges (preferably recently), before running this script${NC}"; exit 1
echo "You made it past the update request bug! Yay!"
fi
fi
tar_extract_cmd() {
local file="${@: -1}"
local flags
case "$file" in
*.tar) flags="" ;;
*.tar.gz) flags="z" ;;
*.tar.xz) flags="J" ;;
*.tar.bz2) flags="j" ;;
*.tar.lzma) flags="J" ;;
*.tar.zst) flags="I unzstd"
if ! which unzstd >/dev/null; then
echo -e "${red}Error: extracting $file requires unzstd${NC}" >&2
return 1
fi
;;
*)
echo -e "${red}Error: Don't know how to extract '$file'${NC}" >&2
return 1
;;
esac
echo "tar -x$flags"
}
# Defining package with full path & defining and creating working directory
package_with_full_path="`readlink -f "${@: -1}"`"
working_directory="`basename "${@: -1}" | tr '[:upper:]' '[:lower:]' | sed s'/\.deb$//'`-working-directory"
working_directory="`pwd`/`basename "${@: -1}" | tr '[:upper:]' '[:lower:]' | sed s'/\.deb$//'`-working-directory"
rm -rf "$working_directory" 2> /dev/null
mkdir "$working_directory" 2> /dev/null
if [[ $(echo $?) != 0 ]]; then
@ -137,139 +184,116 @@ cd "$working_directory"
# Extracting package data and metadata in working directory (also checking package architecture, if you are running the pseudo option)
echo -e "${lightgreen}==>${NC} ${bold}Extracting package data...${normal}"
ar p "$package_with_full_path" control.tar.gz | tar xz
if [[ $pseudo == set ]] && [[ $(grep ^Architecture: control | grep -q i386; echo $?) != 0 ]]; then
echo -e "${red}Error: Invalid package architecture. Removing extracted package data and exiting...${NC}"
cd ..
control_tar_check=$(ar t "$package_with_full_path" | grep -m 1 "control\.tar")
control_extract=$(tar_extract_cmd "$control_tar_check")
if [ $? != 0 ]; then
rm -rf "$working_directory"
exit 1
fi
rm -rf $(ls * | grep -v 'control\|preinst\|postinst\|prerm\|postrm\|conffiles')
data_tar_check=`ar t "$package_with_full_path" | grep data`
if [[ $data_tar_check == data.tar.gz ]]; then
ar p "$package_with_full_path" data.tar.gz | tar xz
elif [[ $data_tar_check == data.tar.xz ]]; then
ar p "$package_with_full_path" data.tar.xz | tar xJ
elif [[ $data_tar_check == data.tar.bz2 ]]; then
ar p "$package_with_full_path" data.tar.bz2 | tar xj
elif [[ $data_tar_check == data.tar.lzma ]]; then
ar p "$package_with_full_path" data.tar.lzma | tar xJ
elif [[ $data_tar_check == data.tar ]]; then
ar p "$package_with_full_path" data.tar | tar x
ar p "$package_with_full_path" "$control_tar_check" | $control_extract
if [[ $pseudo == set ]] && [[ $(grep ^Architecture: control | grep -q i386; echo $?) != 0 ]]; then
echo -e "${red}Error: Invalid package architecture. Removing extracted package data and exiting...${NC}"
rm -rf "$working_directory"
exit 1
fi
rm -rf $(ls * | grep -v 'control\|preinst\|postinst\|prerm\|postrm\|conffiles')
data_tar_check=$(ar t "$package_with_full_path" | grep -m 1 "data\.tar")
data_extract=$(tar_extract_cmd "$data_tar_check")
if [ $? != 0 ]; then
rm -rf "$working_directory"
exit 1
fi
ar p "$package_with_full_path" "$data_tar_check" | $data_extract
# Fixing possible differences in filesystem hierarchy of the extracted package data, so that it matches Arch Linux filesystem hierarchy
echo -e "${lightgreen}==>${NC} ${bold}Fixing possible directories structure differencies...${normal}"
if [[ $pkgbuild == set ]] || [[ $Pkgbuild == set ]]; then
if [[ $(find ./ -iname '*license*' | wc -l) != 0 ]]; then
echo "install -D -m644 \"$(find ./ -iname '*license*' | sort | tail -1 | sed s'/^\.//')\" \"\${pkgdir}/usr/share/licenses/\${pkgname}/LICENSE\"" >> pkgbuildinstallations1
echo "install -D -m644 \"$(find ./ -iname '*license*' | sort | tail -1 | sed s'/^\.\///')\" \"\${pkgdir}/usr/share/licenses/\${pkgname}/LICENSE\"" >> pkgbuildinstallations1
fi
if [[ $(find ./ -iname '*copyright*' | wc -l) != 0 ]]; then
if [[ $(find ./ -iname '*license*' | wc -l) != 0 ]]; then
echo "install -D -m644 \"$(find ./ -iname '*copyright*' | sort | tail -1 | sed s'/^\.//')\" \"\${pkgdir}/usr/share/licenses/\${pkgname}/COPYRIGHT\"" >> pkgbuildinstallations1
echo "install -D -m644 \"$(find ./ -iname '*copyright*' | sort | tail -1 | sed s'/^\.\///')\" \"\${pkgdir}/usr/share/licenses/\${pkgname}/COPYRIGHT\"" >> pkgbuildinstallations1
else
echo "install -D -m644 \"$(find ./ -iname '*copyright*' | sort | tail -1 | sed s'/^\.//')\" \"\${pkgdir}/usr/share/licenses/\${pkgname}/LICENSE\"" >> pkgbuildinstallations1
echo "install -D -m644 \"$(find ./ -iname '*copyright*' | sort | tail -1 | sed s'/^\.\///')\" \"\${pkgdir}/usr/share/licenses/\${pkgname}/LICENSE\"" >> pkgbuildinstallations1
fi
fi
if [[ $(find ./ -iname '*eula*' | wc -l) != 0 ]]; then
if [[ $(find ./ -iname '*license*' | wc -l) != 0 ]] || [[ $(find ./ -iname '*copyright*' | wc -l) != 0 ]]; then
echo "install -D -m644 \"$(find ./ -iname '*eula*' | sort | tail -1 | sed s'/^\.//')\" \"\${pkgdir}/usr/share/licenses/\${pkgname}/EULA\"" >> pkgbuildinstallations1
echo "install -D -m644 \"$(find ./ -iname '*eula*' | sort | tail -1 | sed s'/^\.\///')\" \"\${pkgdir}/usr/share/licenses/\${pkgname}/EULA\"" >> pkgbuildinstallations1
else
echo "install -D -m644 \"$(find ./ -iname '*eula*' | sort | tail -1 | sed s'/^\.//')\" \"\${pkgdir}/usr/share/licenses/\${pkgname}/LICENSE\"" >> pkgbuildinstallations1
echo "install -D -m644 \"$(find ./ -iname '*eula*' | sort | tail -1 | sed s'/^\.\///')\" \"\${pkgdir}/usr/share/licenses/\${pkgname}/LICENSE\"" >> pkgbuildinstallations1
fi
fi
if [[ -e usr/games ]]; then
echo 'mkdir usr/bin 2> /dev/null; mv usr/games/* usr/bin; rm -rf usr/games' >> pkgbuildinstallations1
if [[ -e usr/share/applications ]]; then
for i in usr/share/applications/*.desktop; do
echo "sed -i s'/^Exec=\\/usr\\/games\\//Exec=\\/usr\\/bin\\//g' \"$i\"" >> pkgbuildinstallations1
done
echo -e "ls usr/share/applications/*.desktop | while read line; do\n\tsed -i s'/^Exec=\/usr\/games\//Exec=\/usr\/bin\//g' \"\$line\"\ndone" >> pkgbuildinstallations1
fi
fi
if [[ -e bin ]]; then
echo 'mkdir -p usr/bin 2> /dev/null; mv bin/* usr/bin; rm -rf bin' >> pkgbuildinstallations1
if [[ -e usr/share/applications ]]; then
for i in usr/share/applications/*.desktop; do
echo "sed -i s'/^Exec=\\/bin\\//Exec=\\/usr\\/bin\\//g' \"$i\"" >> pkgbuildinstallations1
done
echo -e "ls usr/share/applications/*.desktop | while read line; do\n\tsed -i s'/^Exec=\/bin\//Exec=\/usr\/bin\//g' \"\$line\"\ndone" >> pkgbuildinstallations1
fi
fi
if [[ -e sbin ]]; then
echo 'mkdir -p usr/bin 2> /dev/null; mv sbin/* usr/bin; rm -rf sbin' >> pkgbuildinstallations1
if [[ -e usr/share/applications ]]; then
for i in usr/share/applications/*.desktop; do
echo "sed -i s'/^Exec=\\/sbin\\//Exec=\\/usr\\/bin\\//g' \"$i\"" >> pkgbuildinstallations1
done
echo -e "ls usr/share/applications/*.desktop | while read line; do\n\tsed -i s'/^Exec=\/sbin\//Exec=\/usr\/bin\//g' \"\$line\"\ndone" >> pkgbuildinstallations1
fi
fi
if [[ -e usr/sbin ]]; then
echo 'mkdir usr/bin 2> /dev/null; mv usr/sbin/* usr/bin; rm -rf usr/sbin' >> pkgbuildinstallations1
if [[ -e usr/share/applications ]]; then
for i in usr/share/applications/*.desktop; do
echo "sed -i s'/^Exec=\\/usr\\/sbin\\//Exec=\\/usr\\/bin\\//g' \"$i\"" >> pkgbuildinstallations1
done
echo -e "ls usr/share/applications/*.desktop | while read line; do\n\tsed -i s'/^Exec=\/usr\/sbin\//Exec=\/usr\/bin\//g' \"\$line\"\ndone" >> pkgbuildinstallations1
fi
fi
if [[ -e usr/local/games ]]; then
echo 'mkdir usr/bin 2> /dev/null; mv usr/local/games/* usr/bin; rm -rf usr/local/games' >> pkgbuildinstallations1
if [[ -e usr/share/applications ]]; then
for i in usr/share/applications/*.desktop; do
echo "sed -i s'/^Exec=\\/usr\\/local\\/games\\//Exec=\\/usr\\/bin\\//g' \"$i\"" >> pkgbuildinstallations1
done
echo -e "ls usr/share/applications/*.desktop | while read line; do\n\tsed -i s'/^Exec=\/usr\/local\/games\//Exec=\/usr\/bin\//g' \"\$line\"\ndone" >> pkgbuildinstallations1
fi
fi
if [[ -e usr/local/bin ]]; then
echo 'mkdir usr/bin 2> /dev/null; mv usr/local/bin/* usr/bin; rm -rf usr/local/bin' >> pkgbuildinstallations1
if [[ -e usr/share/applications ]]; then
for i in usr/share/applications/*.desktop; do
echo "sed -i s'/^Exec=\\/usr\\/local\\/bin\\//Exec=\\/usr\\/bin\\//g' \"$i\"" >> pkgbuildinstallations1
done
echo -e "ls usr/share/applications/*.desktop | while read line; do\n\tsed -i s'/^Exec=\/usr\/local\/bin\//Exec=\/usr\/bin\//g' \"\$line\"\ndone" >> pkgbuildinstallations1
fi
fi
if [[ -e usr/local/sbin ]]; then
echo 'mkdir usr/bin 2> /dev/null; mv usr/local/sbin/* usr/bin; rm -rf usr/local/sbin' >> pkgbuildinstallations1
if [[ -e usr/share/applications ]]; then
for i in usr/share/applications/*.desktop; do
echo "sed -i s'/^Exec=\\/usr\\/local\\/sbin\\//Exec=\\/usr\\/bin\\//g' \"$i\"" >> pkgbuildinstallations1
done
echo -e "ls usr/share/applications/*.desktop | while read line; do\n\tsed -i s'/^Exec=\/usr\/local\/sbin\//Exec=\/usr\/bin\//g' \"\$line\"\ndone" >> pkgbuildinstallations1
fi
fi
if [[ -e lib32 ]]; then
echo 'mkdir -p usr/lib 2> /dev/null; mv lib32/* usr/lib; rm -rf lib32' >> pkgbuildinstallations32
fi
if [[ -e usr/lib32 ]]; then
echo 'mkdir usr/lib 2> /dev/null; mv usr/lib32/* usr/lib; rm -rf usr/lib32' >> pkgbuildinstallations32
fi
if [[ -e usr/local/lib ]]; then
echo 'mkdir usr/lib 2> /dev/null; mv usr/local/lib/* usr/lib; rm -rf usr/local/lib' >> pkgbuildinstallations32
fi
if [[ -e usr/local/lib32 ]]; then
echo 'mkdir usr/lib 2> /dev/null; mv usr/local/lib32/* usr/lib; rm -rf usr/local/lib32' >> pkgbuildinstallations32
fi
if [[ $pseudo != set ]]; then
if [[ -e lib ]]; then
echo 'mkdir -p usr/lib 2> /dev/null; mv lib/* usr/lib; rm -rf lib' >> pkgbuildinstallations1
fi
if [[ -e lib32 ]]; then
echo 'mkdir -p usr/lib32 2> /dev/null; mv lib32/* usr/lib32; rm -rf lib32' >> pkgbuildinstallations64
if [[ $(grep -i ^Architecture: control | grep -q i386; echo $?) == 0 ]]; then
echo 'mkdir -p usr/lib 2> /dev/null; mv lib32/* usr/lib; rm -rf lib32' >> pkgbuildinstallations32
else
echo 'mkdir -p usr/lib32 2> /dev/null; mv lib32/* usr/lib32; rm -rf lib32' >> pkgbuildinstallations64
fi
fi
if [[ -e lib64 ]]; then
echo 'mkdir -p usr/lib 2> /dev/null; mv lib64/* usr/lib; rm -rf lib64' >> pkgbuildinstallations64
fi
if [[ -e usr/lib32 ]]; then
echo 'mkdir usr/lib32 2> /dev/null; mv usr/lib32/* usr/lib32; rm -rf usr/lib32' >> pkgbuildinstallations64
if [[ -e usr/lib32 ]] && [[ $(grep -i ^Architecture: control | grep -q i386; echo $?) == 0 ]]; then
echo 'mkdir usr/lib 2> /dev/null; mv usr/lib32/* usr/lib; rm -rf usr/lib32' >> pkgbuildinstallations32
fi
if [[ -e usr/lib64 ]]; then
echo 'mkdir usr/lib 2> /dev/null; mv usr/lib64/* usr/lib; rm -rf usr/lib64' >> pkgbuildinstallations64
fi
if [[ -e usr/local/lib ]]; then
echo 'mkdir usr/lib 2> /dev/null; mv usr/local/lib/* usr/lib; rm -rf usr/local/lib' >> pkgbuildinstallations64
fi
if [[ -e usr/local/lib32 ]]; then
echo 'mkdir usr/lib32 2> /dev/null; mv usr/local/lib32/* usr/lib32; rm -rf usr/local/lib32' >> pkgbuildinstallations64
if [[ -e usr/local/lib32 ]] && [[ $(grep -i ^Architecture: control | grep -q i386; echo $?) == 0 ]]; then
echo 'mkdir usr/local/lib 2> /dev/null; mv usr/local/lib32/* usr/local/lib; rm -rf usr/local/lib32' >> pkgbuildinstallations32
fi
if [[ -e usr/local/lib64 ]]; then
echo 'mkdir usr/lib 2> /dev/null; mv usr/local/lib64/* usr/lib; rm -rf usr/local/lib64' >> pkgbuildinstallations64
echo 'mkdir usr/local/lib 2> /dev/null; mv usr/local/lib64/* usr/local/lib; rm -rf usr/local/lib64' >> pkgbuildinstallations64
fi
else
if [[ -e lib ]]; then
@ -283,10 +307,7 @@ if [[ $pkgbuild == set ]] || [[ $Pkgbuild == set ]]; then
echo 'mkdir usr/lib32 2> /dev/null; mv usr/lib/* usr/lib32; rm -rf usr/lib' >> pkgbuildinstallations64
fi
if [[ -e usr/local/lib ]]; then
echo 'mkdir usr/lib32 2> /dev/null; mv usr/local/lib/* usr/lib32; rm -rf usr/local/lib' >> pkgbuildinstallations64
fi
if [[ -e usr/local/lib32 ]]; then
echo 'mkdir usr/lib32 2> /dev/null; mv usr/local/lib32/* usr/lib32; rm -rf usr/local/lib32' >> pkgbuildinstallations64
echo 'mkdir usr/local/lib32 2> /dev/null; mv usr/local/lib/* usr/local/lib32; rm -rf usr/local/lib' >> pkgbuildinstallations64
fi
fi
fi
@ -313,8 +334,8 @@ if [[ -e usr/local/sbin ]]; then
mkdir usr/bin 2> /dev/null; mv usr/local/sbin/* usr/bin; rm -rf usr/local/sbin
fi
if [[ -e usr/share/applications ]]; then
for i in usr/share/applications/*.desktop; do
sed -i -e s'/^Exec=\/bin\//Exec=\/usr\/bin\//g' -e s'/^Exec=\/sbin\//Exec=\/usr\/bin\//g' -e s'/^Exec=\/usr\/sbin\//Exec=\/usr\/bin\//g' -e s'/^Exec=\/usr\/games\//Exec=\/usr\/bin\//g' -e s'/^Exec=\/usr\/local\/bin\//Exec=\/usr\/bin\//g' -e s'/^Exec=\/usr\/local\/sbin\//Exec=\/usr\/bin\//g' -e s'/^Exec=\/usr\/local\/games\//Exec=\/usr\/bin\//g' "$i" 2> /dev/null
ls usr/share/applications/*.desktop | while read line; do
sed -i -e s'/^Exec=\/bin\//Exec=\/usr\/bin\//g' -e s'/^Exec=\/sbin\//Exec=\/usr\/bin\//g' -e s'/^Exec=\/usr\/sbin\//Exec=\/usr\/bin\//g' -e s'/^Exec=\/usr\/games\//Exec=\/usr\/bin\//g' -e s'/^Exec=\/usr\/local\/bin\//Exec=\/usr\/bin\//g' -e s'/^Exec=\/usr\/local\/sbin\//Exec=\/usr\/bin\//g' -e s'/^Exec=\/usr\/local\/games\//Exec=\/usr\/bin\//g' "$line" 2> /dev/null
done
fi
if [[ $pseudo != set ]]; then
@ -322,7 +343,7 @@ if [[ $pseudo != set ]]; then
mkdir -p usr/lib 2> /dev/null; mv lib/* usr/lib; rm -rf lib
fi
if [[ -e lib32 ]]; then
if [[ $(grep ^Architecture: control | grep -q i386; echo $?) == 0 ]]; then
if [[ $(grep -i ^Architecture: control | grep -q i386; echo $?) == 0 ]]; then
mkdir -p usr/lib 2> /dev/null; mv lib32/* usr/lib; rm -rf lib32
else
mkdir -p usr/lib32 2> /dev/null; mv lib32/* usr/lib32; rm -rf lib32
@ -331,24 +352,17 @@ if [[ $pseudo != set ]]; then
if [[ -e lib64 ]]; then
mkdir -p usr/lib 2> /dev/null; mv lib64/* usr/lib; rm -rf lib64
fi
if [[ -e usr/lib32 ]] && [[ $(grep ^Architecture: control | grep -q i386; echo $?) == 0 ]]; then
if [[ -e usr/lib32 ]] && [[ $(grep -i ^Architecture: control | grep -q i386; echo $?) == 0 ]]; then
mkdir usr/lib 2> /dev/null; mv usr/lib32/* usr/lib; rm -rf usr/lib32
fi
if [[ -e usr/lib64 ]]; then
mkdir usr/lib 2> /dev/null; mv usr/lib64/* usr/lib; rm -rf usr/lib64
fi
if [[ -e usr/local/lib ]]; then
mkdir usr/lib 2> /dev/null; mv usr/local/lib/* usr/lib; rm -rf usr/local/lib
fi
if [[ -e usr/local/lib32 ]]; then
if [[ $(grep ^Architecture: control | grep -q i386; echo $?) == 0 ]]; then
mkdir usr/lib 2> /dev/null; mv usr/local/lib32/* usr/lib; rm -rf usr/local/lib32
else
mkdir usr/lib32 2> /dev/null; mv usr/local/lib32/* usr/lib32; rm -rf usr/local/lib32
fi
if [[ -e usr/local/lib32 ]] && [[ $(grep -i ^Architecture: control | grep -q i386; echo $?) == 0 ]]; then
mkdir usr/local/lib 2> /dev/null; mv usr/local/lib32/* usr/local/lib; rm -rf usr/local/lib32
fi
if [[ -e usr/local/lib64 ]]; then
mkdir usr/lib 2> /dev/null; mv usr/local/lib64/* usr/lib; rm -rf usr/local/lib64
mkdir usr/local/lib 2> /dev/null; mv usr/local/lib64/* usr/local/lib; rm -rf usr/local/lib64
fi
else
if [[ -e lib ]]; then
@ -361,23 +375,18 @@ else
mkdir usr/lib32 2> /dev/null; mv usr/lib/* usr/lib32; rm -rf usr/lib
fi
if [[ -e usr/local/lib ]]; then
mkdir usr/lib32 2> /dev/null; mv usr/local/lib/* usr/lib32; rm -rf usr/local/lib
mkdir usr/local/lib32 2> /dev/null; mv usr/local/lib/* usr/local/lib32; rm -rf usr/local/lib
fi
if [[ -e usr/local/lib32 ]]; then
mkdir usr/lib32 2> /dev/null; mv usr/local/lib32/* usr/lib32; rm -rf usr/local/lib32
fi
fi
if [[ $pkgbuild == set ]] || [[ $Pkgbuild == set ]]; then
if [[ -e usr/local ]] && [[ $(ls -A usr/local 2> /dev/null) ]]; then
echo 'mv usr/local/* usr; rm -rf usr/local' >> pkgbuildinstallations2
if [[ -e usr/local ]] && [[ ! $(ls -A usr/local 2> /dev/null) ]]; then
echo 'rm -rf usr/local' >> pkgbuildinstallations2
fi
fi
if [[ -e usr/local ]]; then
mv usr/local/* usr; rm -rf usr/local
if [[ -e usr/local ]] && [[ ! $(ls -A usr/local 2> /dev/null) ]]; then
rm -rf usr/local
fi
# Generating .PKGINFO file
@ -386,42 +395,42 @@ echo -e "${lightgreen}==>${NC} ${bold}Generating .PKGINFO file...${normal}"
# Generating pkgname field
if [[ $pseudo == set ]] && [[ $(ls -A usr/lib32 2> /dev/null) ]] && [[ ! $(ls -A usr/bin 2> /dev/null) ]]; then
for i in {git,bzr,darcs,hg}; do
if [[ $(grep ^Version: control | gawk '{print $2}' | grep -q $i; echo $?) == 0 ]]; then
echo "pkgname = lib32-`grep ^Package: control | gawk '{print $2}' | tr '[:upper:]' '[:lower:]'`"-$i | sed s"/-$i-$i$/-$i/" | sed s'/--/-/g' > .PKGINFO
if [[ $(grep -i ^Version: control | gawk '{print $2}' | grep -q $i; echo $?) == 0 ]]; then
echo "pkgname = lib32-`grep -i ^Package: control | gawk '{print $2}' | tr '[:upper:]' '[:lower:]'`"-$i | sed s"/-$i-$i$/-$i/" | sed s'/--/-/g' > .PKGINFO
fi
done
if [[ $(grep ^Version: control | gawk '{print $2}' | grep -q svn; echo $?) == 0 ]]; then
echo "pkgname = lib32-`grep ^Package: control | gawk '{print $2}' | tr '[:upper:]' '[:lower:]'`"-svn | sed s'/-svn-svn$/-svn/' | sed s'/--/-/g' > .PKGINFO
if [[ $(grep -i ^Version: control | gawk '{print $2}' | grep -q svn; echo $?) == 0 ]]; then
echo "pkgname = lib32-`grep -i ^Package: control | gawk '{print $2}' | tr '[:upper:]' '[:lower:]'`"-svn | sed s'/-svn-svn$/-svn/' | sed s'/--/-/g' > .PKGINFO
fi
for i in {cvs,CVS}; do
if [[ $(grep ^Version: control | gawk '{print $2}' | grep -q $i; echo $?) == 0 ]]; then
echo "pkgname = lib32-`grep ^Package: control | gawk '{print $2}' | tr '[:upper:]' '[:lower:]'`"-cvs | sed s'/-cvs-cvs$/-cvs/' | sed s'/--/-/g' > .PKGINFO
if [[ $(grep -i ^Version: control | gawk '{print $2}' | grep -q $i; echo $?) == 0 ]]; then
echo "pkgname = lib32-`grep -i ^Package: control | gawk '{print $2}' | tr '[:upper:]' '[:lower:]'`"-cvs | sed s'/-cvs-cvs$/-cvs/' | sed s'/--/-/g' > .PKGINFO
fi
done
if [[ $(grep ^Version: control | gawk '{print $2}' | grep -q "svn\|git\|cvs\|CVS\|bzr\|darcs\|hg"; echo $?) != 0 ]]; then
echo "pkgname = lib32-`grep ^Package: control | gawk '{print $2}' | tr '[:upper:]' '[:lower:]'`" | sed s'/--/-/g' > .PKGINFO
if [[ $(grep -i ^Version: control | gawk '{print $2}' | grep -q "svn\|git\|cvs\|CVS\|bzr\|darcs\|hg"; echo $?) != 0 ]]; then
echo "pkgname = lib32-`grep -i ^Package: control | gawk '{print $2}' | tr '[:upper:]' '[:lower:]'`" | sed s'/--/-/g' > .PKGINFO
fi
else
for i in {git,bzr,darcs,hg}; do
if [[ $(grep ^Version: control | gawk '{print $2}' | grep -q $i; echo $?) == 0 ]]; then
echo "pkgname = `grep ^Package: control | gawk '{print $2}' | tr '[:upper:]' '[:lower:]'`"-$i | sed s"/-$i-$i$/-$i/" | sed s'/--/-/g' > .PKGINFO
if [[ $(grep -i ^Version: control | gawk '{print $2}' | grep -q $i; echo $?) == 0 ]]; then
echo "pkgname = `grep -i ^Package: control | gawk '{print $2}' | tr '[:upper:]' '[:lower:]'`"-$i | sed s"/-$i-$i$/-$i/" | sed s'/--/-/g' > .PKGINFO
fi
done
if [[ $(grep ^Version: control | gawk '{print $2}' | grep -q svn; echo $?) == 0 ]]; then
echo "pkgname = `grep ^Package: control | gawk '{print $2}' | tr '[:upper:]' '[:lower:]'`"-svn | sed s'/-svn-svn$/-svn/' | sed s'/--/-/g' > .PKGINFO
if [[ $(grep -i ^Version: control | gawk '{print $2}' | grep -q svn; echo $?) == 0 ]]; then
echo "pkgname = `grep -i ^Package: control | gawk '{print $2}' | tr '[:upper:]' '[:lower:]'`"-svn | sed s'/-svn-svn$/-svn/' | sed s'/--/-/g' > .PKGINFO
fi
for i in {cvs,CVS}; do
if [[ $(grep ^Version: control | gawk '{print $2}' | grep -q $i; echo $?) == 0 ]]; then
echo "pkgname = `grep ^Package: control | gawk '{print $2}' | tr '[:upper:]' '[:lower:]'`"-cvs | sed s'/-cvs-cvs$/-cvs/' | sed s'/--/-/g' > .PKGINFO
if [[ $(grep -i ^Version: control | gawk '{print $2}' | grep -q $i; echo $?) == 0 ]]; then
echo "pkgname = `grep -i ^Package: control | gawk '{print $2}' | tr '[:upper:]' '[:lower:]'`"-cvs | sed s'/-cvs-cvs$/-cvs/' | sed s'/--/-/g' > .PKGINFO
fi
done
if [[ $(grep ^Version: control | gawk '{print $2}' | grep -q "svn\|git\|cvs\|CVS\|bzr\|darcs\|hg"; echo $?) != 0 ]]; then
echo "pkgname = `grep ^Package: control | gawk '{print $2}' | tr '[:upper:]' '[:lower:]'`" | sed s'/demo$/-demo/' | sed s'/trial$/-trial/' | sed s'/--/-/g' > .PKGINFO
if [[ $(grep -i ^Version: control | gawk '{print $2}' | grep -q "svn\|git\|cvs\|CVS\|bzr\|darcs\|hg"; echo $?) != 0 ]]; then
echo "pkgname = `grep -i ^Package: control | gawk '{print $2}' | tr '[:upper:]' '[:lower:]'`" | sed s'/demo$/-demo/' | sed s'/trial$/-trial/' | sed s'/--/-/g' > .PKGINFO
fi
fi
# Generating pkgver field
version=$(grep ^Version: control | gawk '{print $2}' | sed -e s'/[+~]/-/g' -e s'/[-._]alpha/alpha/' -e s'/[-._]beta/beta/' -e s'/[-._]pre/pre/' -e s'/[-._]rc/rc/' -e s'/[-._]dfsg/dfsg/' | gawk -F 'dev' '{print $1}' | sed -e s'/-\(ubuntu\|debian\|build\|dfsg\|nobinonly\|ppa\|nmu\|deb\)[0-9]\+\.[0-9]\+\.[0-9]\+//g' -e s'/-[0-9]\+\.[0-9]\+\(ubuntu\|debian\|build\|dfsg\|nobinonly\|ppa\|nmu\|deb\)[0-9]\+\.[0-9]\+[a-z]*[0-9]*//g' -e s'/-[0-9]\+\.[0-9]\+\(ubuntu\|debian\|build\|dfsg\|nobinonly\|ppa\|nmu\|deb\)[0-9]\+[a-z]*[0-9]*//g' -e s'/-[0-9]*\(ubuntu\|debian\|build\|dfsg\|nobinonly\|ppa\|nmu\|deb\)[0-9]\+\.[0-9]\+[a-z]*[0-9]*//g' -e s'/-[0-9]*\(ubuntu\|debian\|build\|dfsg\|nobinonly\|ppa\|nmu\|deb\)[0-9]\+[a-z]*[0-9]*//g' -e s'/[a-z]*\(ubuntu\|debian\|build\|dfsg\|nobinonly\|ppa\|nmu\|deb\)[0-9]\+\.[0-9]\+[a-z]*[0-9]*//g' -e s'/[a-z]*\(ubuntu\|debian\|build\|dfsg\|nobinonly\|ppa\|nmu\|deb\)[0-9]*[a-z]*[0-9]*//g' -e s'/--/-/g' -e s'/\.\././g' | sed s'/\.$//')
version=$(grep -i ^Version: control | gawk '{print $2}' | sed -e s'/[+~]/-/g' -e s'/[-._]alpha/alpha/' -e s'/[-._]beta/beta/' -e s'/[-._]pre/pre/' -e s'/[-._]rc/rc/' -e s'/[-._]dfsg/dfsg/' | gawk -F 'dev' '{print $1}' | sed -e s'/-\(ubuntu\|debian\|build\|dfsg\|nobinonly\|ppa\|nmu\|deb\)[0-9]\+\.[0-9]\+\.[0-9]\+//g' -e s'/-[0-9]\+\.[0-9]\+\(ubuntu\|debian\|build\|dfsg\|nobinonly\|ppa\|nmu\|deb\)[0-9]\+\.[0-9]\+[a-z]*[0-9]*//g' -e s'/-[0-9]\+\.[0-9]\+\(ubuntu\|debian\|build\|dfsg\|nobinonly\|ppa\|nmu\|deb\)[0-9]\+[a-z]*[0-9]*//g' -e s'/-[0-9]*\(ubuntu\|debian\|build\|dfsg\|nobinonly\|ppa\|nmu\|deb\)[0-9]\+\.[0-9]\+[a-z]*[0-9]*//g' -e s'/-[0-9]*\(ubuntu\|debian\|build\|dfsg\|nobinonly\|ppa\|nmu\|deb\)[0-9]\+[a-z]*[0-9]*//g' -e s'/[a-z]*\(ubuntu\|debian\|build\|dfsg\|nobinonly\|ppa\|nmu\|deb\)[0-9]\+\.[0-9]\+[a-z]*[0-9]*//g' -e s'/[a-z]*\(ubuntu\|debian\|build\|dfsg\|nobinonly\|ppa\|nmu\|deb\)[0-9]*[a-z]*[0-9]*//g' -e s'/--/-/g' -e s'/\.\././g' | sed s'/\.$//')
for i in {git,bzr,darcs,hg}; do
if [[ $(echo $version | grep -q $i; echo $?) == 0 ]]; then
echo "pkgver = `echo $version | gawk -F "$i" '{print $2}' | gawk -F '-' '{print $1}'`"-1 >> .PKGINFO
@ -445,15 +454,15 @@ if [[ $(echo $version | grep -q "svn\|git\|cvs\|CVS\|bzr\|darcs\|hg"; echo $?) !
fi
# Generating pkgdesc field
if [[ $(echo `grep -v ":\| \." control` | grep -iq "`grep ^Description: control | sed s'/^Description: //' | sed s'/\.//'`"; echo $?) == 0 ]]; then
if [[ $(echo `grep -v ":\| \." control` | grep -iq "`grep -i ^Description: control | sed s'/^Description: //i' | sed s'/\.//'`"; echo $?) == 0 ]]; then
description=$(echo $(echo "`grep -v ":\| \." control`") | sed s'/^\s*./\U&\E/g' | sed s'/\(\. \|\! \|\? \)\s*./\U&\E/g')
else
description=$(echo $(echo "`grep ^Description: control | sed s'/^Description: //' | sed 's/.*/\u&/'`" | sed s'/\.//'). `grep -v ":\| \." control` | sed s'/^\s*./\U&\E/g' | sed s'/\(\. \|\! \|\? \)\s*./\U&\E/g')
description=$(echo $(echo "`grep -i ^Description: control | sed s'/^Description: //i' | sed 's/.*/\u&/'`" | sed s'/\.//'). `grep -v ":\| \." control` | sed s'/^\s*./\U&\E/g' | sed s'/\(\. \|\! \|\? \)\s*./\U&\E/g' | sed s'/\!\./\!/g' | sed s'/\?\./\?/g')
fi
echo "pkgdesc = $description" >> .PKGINFO
# Generating url field
echo "url = `grep ^Homepage: control | gawk '{print $2}'`" | sed s'/\/$//' >> .PKGINFO
echo "url = `grep -i ^Homepage: control | gawk '{print $2}'`" | sed s'/\/$//' >> .PKGINFO
# Generating builddate (which is actually packaging date) field
echo "builddate = `date -u "+%s"`" >> .PKGINFO
@ -462,14 +471,16 @@ echo "builddate = `date -u "+%s"`" >> .PKGINFO
if [[ $quiet == set ]] || [[ $Quiet == set ]]; then
echo "packager = Unknown Packager" >> .PKGINFO
else
echo -e "\n${lightblue}::${NC} Enter Packager name:"
read packager_name
source /usr/share/makepkg/util/config.sh
load_makepkg_config
echo -e "\n${lightblue}::${NC} Enter Packager name (can be left blank):"
read -e -i "${PACKAGER}" packager_name
echo "packager = $packager_name" >> .PKGINFO
fi
# Generating arch field
if [[ $pseudo != set ]]; then
echo "arch = `grep ^Architecture: control | gawk '{print $2}' | sed -e s'/i386/i686/' -e s'/amd64/x86_64/' -e s'/armhf/armv7h/' -e s'/arm64/aarch64/' -e s'/all/any/'`" >> .PKGINFO
echo "arch = `grep -i ^Architecture: control | gawk '{print $2}' | sed -e s'/i386/i686/' -e s'/amd64/x86_64/' -e s'/armhf/armv7h/' -e s'/arm64/aarch64/' -e s'/all/any/'`" >> .PKGINFO
else
echo "arch = x86_64" >> .PKGINFO
fi
@ -526,7 +537,7 @@ echo "size =" $((`du -sb | tr -d " ."` - `ls -l | grep control | gawk '{print $5
if [[ $quiet == set ]] || [[ $Quiet == set ]]; then
echo "license = custom" >> .PKGINFO
else
echo -e "\n${lightblue}::${NC} Enter package license (you can enter multiple licenses comma separated):"
echo -e "\n${lightblue}::${NC} Enter package license (can be left blank, you can enter multiple licenses comma separated):"
read package_license
for i in `echo "$package_license" | sed -e s'/ /__/g' -e s'/,/ /g'`; do
license+=($i)
@ -545,9 +556,9 @@ echo -e "\n${lightgreen}***${NC} ${bold}Creation of .PKGINFO file in progress. I
packages-names-translator() {
# First method of translating .deb packages names into Arch Linux packages names, more accurate, comparing contents of .deb packages with Arch Linux packages contents
for debian_package_name in $(gawk '{print $1}' `ls | grep initial-check-list`); do
for debian_package_file in `grep "\/$debian_package_name$" /var/cache/debtap/debian-packages-files | grep 'bin\|opt\|\.so' | gawk '{print $1}' | sed s'/\// /g' | gawk '{print $NF}'`; do
for debian_package_file in `grep "\/$debian_package_name$" /var/cache/debtap/debian-main-packages-files /var/cache/debtap/debian-non-free-packages-files /var/cache/debtap/debian-contrib-packages-files | grep 'bin\|opt\|\.so' | gawk '{print $1}' | sed s'/\// /g' | gawk '{print $NF}'`; do
echo $debian_package_file $(grep "^$debian_package_name$\|^$debian_package_name " `ls | grep initial-check-list` | gawk '{print $2}')
done >> $debian_package_name-tempfile03
done >> $debian_package_name-tempfile03
done
for i in `ls | grep tempfile03`; do
@ -603,7 +614,7 @@ done
# Second method of translating remaining untranslated .deb packages names into Arch Linux packages names, same as first method, but searches in Ubuntu database for packages contents instead of Debian database
if [[ -e untranslated-names-only ]]; then
for ubuntu_package_name in $(sort -u untranslated-names-only); do
for ubuntu_package_file in `grep "\/$ubuntu_package_name$" /var/cache/debtap/ubuntu-packages-files | grep 'bin\|opt\|\.so' | gawk '{print $1}' | sed s'/\// /g' | gawk '{print $NF}'`; do
for ubuntu_package_file in `grep "\/$ubuntu_package_name$" /var/cache/debtap/ubuntu-packages-files | grep 'bin\|opt\|\.so' | gawk '{print $1}' | sed s'/\// /g' | gawk '{print $NF}'`; do
echo $ubuntu_package_file $(grep "^$ubuntu_package_name$\|^$ubuntu_package_name " untranslated | gawk '{print $2}')
done >> $ubuntu_package_name-tempfile08
done
@ -2675,6 +2686,8 @@ grep -q "^default-jre$\|^default-jre " tempfile02 && echo java-runtime >> final-
grep -q "^python:any$\|^python:any " tempfile02 && echo python >> final-check-list
grep "^openjdk-[0-9]+-jdk$\|^openjdk-[0-9]+-jdk " tempfile02 | sort -uV | tail -1 | sed s"/openjdk-\([0-9]\+\)-jdk/jdk\1-openjdk/g" | sed s'/=/= /g' | sed s'/>/> /g' | sed s'/</< /g' | sed s'/> =/>=/g' | sed s'/< =/<=/g' >> final-check-list
grep "^openjdk-[0-9]+-jre\(-headless\)\?$\|^openjdk-[0-9]+-jre\(-headless\)\? " tempfile02 | sort -uV | tail -1 | sed s"/openjdk-\([0-9]\+\)-jre/jre\1-openjdk/g" | sed s'/=/= /g' | sed s'/>/> /g' | sed s'/</< /g' | sed s'/> =/>=/g' | sed s'/< =/<=/g' >> final-check-list
grep "^libstdc[0-9]+$\|libstdc[0-9]+ " tempfile02 | sort -uV | tail -1 | sed s"/libstdc\([0-9]\+\)/$(pacman -Ssq libstdc | sort -uV | tail -1)/g" | sed s'/=/= /g' | sed s'/>/> /g' | sed s'/</< /g' | sed s'/> =/>=/g' | sed s'/< =/<=/g' >> final-check-list
grep "^qt[0-9]+-default$\|qt[0-9]+-default " tempfile02 | sed s"/qt\([0-9]\+\)-default/qt\1-base/g" | sed s'/=/= /g' | sed s'/>/> /g' | sed s'/</< /g' | sed s'/> =/>=/g' | sed s'/< =/<=/g' >> final-check-list
if [[ $pseudo != set ]]; then
grep -q "^xlibs$\|^xlibs " tempfile02 && echo libx11 >> final-check-list
grep -q "^libgl1$\|^libgl1 " tempfile02 && echo libgl >> final-check-list
@ -2682,6 +2695,7 @@ if [[ $pseudo != set ]]; then
grep "^libpango$\|^libpango " tempfile02 | sed s"/libpango/pango/g" | sed s'/=/= /g' | sed s'/>/> /g' | sed s'/</< /g' | sed s'/> =/>=/g' | sed s'/< =/<=/g' >> final-check-list
grep "^libpangomm$\|^libpangomm " tempfile02 | sed s"/libpangomm/pangomm/g" | sed s'/=/= /g' | sed s'/>/> /g' | sed s'/</< /g' | sed s'/> =/>=/g' | sed s'/< =/<=/g' >> final-check-list
grep "^libcupsys2$\|^libcupsys2 " tempfile02 | sed s"/libcupsys2/libcups/g" | sed s'/=/= /g' | sed s'/>/> /g' | sed s'/</< /g' | sed s'/> =/>=/g' | sed s'/< =/<=/g' >> final-check-list
grep "^jackd[0-9]*$\|^jackd-[0-9]* " tempfile02 | sort -uV | tail -1 | sed s"/jackd\([0-9]\*\)/jack\1/g" | sed s'/=/= /g' | sed s'/>/> /g' | sed s'/</< /g' | sed s'/> =/>=/g' | sed s'/< =/<=/g' >> final-check-list
else
grep -q "^xlibs$\|^xlibs " tempfile02 && echo lib32-libx11 >> final-check-list
grep -q "^libgl1$\|^libgl1 " tempfile02 && echo lib32-libgl >> final-check-list
@ -2689,6 +2703,7 @@ else
grep "^libpango$\|^libpango " tempfile02 | sed s"/libpango/lib32-pango/g" | sed s'/=/= /g' | sed s'/>/> /g' | sed s'/</< /g' | sed s'/> =/>=/g' | sed s'/< =/<=/g' >> final-check-list
grep "^libpangomm$\|^libpangomm " tempfile02 | sed s"/libpangomm/lib32-pangomm/g" | sed s'/=/= /g' | sed s'/>/> /g' | sed s'/</< /g' | sed s'/> =/>=/g' | sed s'/< =/<=/g' >> final-check-list
grep "^libcupsys2$\|^libcupsys2 " tempfile02 | sed s"/libcupsys2/lib32-libcups/g" | sed s'/=/= /g' | sed s'/>/> /g' | sed s'/</< /g' | sed s'/> =/>=/g' | sed s'/< =/<=/g' >> final-check-list
grep "^jackd[0-9]*$\|^jackd-[0-9]* " tempfile02 | sort -uV | tail -1 | sed s"/jackd\([0-9]\*\)/lib32-jack\1/g" | sed s'/=/= /g' | sed s'/>/> /g' | sed s'/</< /g' | sed s'/> =/>=/g' | sed s'/< =/<=/g' >> final-check-list
fi
# Stripping unnecessary symbols and words from packages versions
@ -2744,6 +2759,7 @@ if [[ -e dependencies-initial-check-list ]]; then
pkgfile -q "$i" | head -1 >> tempfile15
done
# Removing packages names that are part of base group (if any exist)
touch tempfile15-1
sort -u tempfile15 | grep -v '^$' | while read line; do
if [[ $(grep -q "^$(echo "$line" | gawk '{print $1}' | sed s'/-svn$\|-git$\|-cvs$\|-bzr$\|-darcs$\|-hg$//')$" /var/cache/debtap/base-packages; echo $?) != 0 ]]; then
echo "$line" >> tempfile15-1
@ -2759,6 +2775,7 @@ sort -u tempfile15 > tempfile16
gawk '{print $1}' tempfile16 | sort -u > tempfile17
# Removing packages names that are the same with the name of the package to be converted from translated packages list (if any exist)
touch tempfile18
for i in `cat tempfile17`; do
if [[ $(echo " $(echo $(grep ^pkgname .PKGINFO | gawk '{print $3}' | sed s'/-svn$\|-git$\|-cvs$\|-bzr$\|-darcs$\|-hg$//'){-svn,-git,-cvs,-bzr,-darcs,-hg,}) " | grep -q " $(echo $i | sed s'/^lib32-\|-multilib$//') "; echo $?) != 0 ]]; then
echo "$i" >> tempfile18
@ -2766,7 +2783,8 @@ for i in `cat tempfile17`; do
fi
done
if [[ $wipeout != set ]]; then
touch tempfile22
if [[ $wipeout != set ]] && [[ $(ls *-tempfile19 &> /dev/null; echo $?) == 0 ]]; then
# Isolating versions from packages
for i in `ls | grep tempfile19`; do
if [[ $(grep -q "=\|>\|<" $i; echo $?) != 0 ]]; then
@ -2809,49 +2827,49 @@ fi
# Generating replacements fields
if [[ $(grep -q ^Replaces: control; echo $?) == 0 ]]; then
grep ^Replaces: control | sed -e s'/^Replaces: //g' -e s'/ (/(/g' -e s'/= /=/g' -e s'/>> />/g' -e s'/<< /</g' -e s'/|/ /g' | tr -d "," | while read line; do
grep -i ^Replaces: control | sed -e s'/^Replaces://g' -e s'/^ //g' -e s'/ (/(/g' -e s'/= /=/g' -e s'/>> />/g' -e s'/<< /</g' -e s'/,\||/ /g' -e s'/ / /g' | while read line; do
for word in $line; do
echo $word >> tempfile01
done
done
sed -e s'/(/ /g' -e s'/)//g' tempfile01 | sort > tempfile02
grep -v '^xlibs$\|^xlibs \|^libgl1$\|^libgl1 \|^libglu1$\|^libglu1 \|^default-jre$\|^default-jre \|^openjdk-[0-9]+-[jdk|jre]\|^python:any$\|^python:any \|^libpango\|^libcupsys2$\|^libcupsys2 \|^fonts-freefont-ttf$\|^fonts-freefont-ttf \|^fonts-liberation$\|^fonts-liberation \|^ttf-mscorefonts-installer$\|^ttf-mscorefonts-installer \|^dpkg$\|^dpkg \|^apt$\|^apt \|^apt-get$\|^apt-get \|^aptitude$\|^aptitude \|^debconf' tempfile02 > replacements-initial-check-list
grep -v '^xlibs$\|^xlibs \|^libgl1$\|^libgl1 \|^libglu1$\|^libglu1 \|^default-jre$\|^default-jre \|^openjdk-[0-9]+-[jdk|jre]\|^libstdc[0-9]+$\|^libstdc[0-9]+ \|^qt[0-9]+-default$\|^qt[0-9]+-default \|^python:any$\|^python:any \|^libpango\|^libcupsys2$\|^libcupsys2 \|^jackd[0-9]*$\|^jackd[0-9]* \|^fonts-freefont-ttf$\|^fonts-freefont-ttf \|^fonts-liberation$\|^fonts-liberation \|^ttf-mscorefonts-installer$\|^ttf-mscorefonts-installer \|^dpkg$\|^dpkg \|^apt$\|^apt \|^apt-get$\|^apt-get \|^aptitude$\|^aptitude \|^debconf' tempfile02 > replacements-initial-check-list
packages-names-translator
if [[ $wipeout != set ]]; then
for i in `sort -u tempfile22`; do echo "replaces = $i" >> .PKGINFO; done
else
for i in `sort -u tempfile18`; do echo "replaces = $i" >> .PKGINFO; done
for i in `sort -u tempfile18`; do echo "replaces = $i" >> .PKGINFO; done
fi
rm -rf *tempfile* replacements-initial-check-list final-check-list
rm -rf *tempfile* replacements-initial-check-list final-check-list
fi
# Generating conflicts fields
if [[ $(grep -q ^Conflicts: control; echo $?) == 0 ]]; then
grep ^Conflicts: control | sed -e s'/^Conflicts: //g' -e s'/ (/(/g' -e s'/= /=/g' -e s'/>> />/g' -e s'/<< /</g' -e s'/|/ /g' | tr -d "," | while read line; do
grep -i ^Conflicts: control | sed -e s'/^Conflicts://g' -e s'/^ //g' -e s'/ (/(/g' -e s'/= /=/g' -e s'/>> />/g' -e s'/<< /</g' -e s'/,\||/ /g' -e s'/ / /g' | while read line; do
for word in $line; do
echo $word >> tempfile01
done
done
sed -e s'/(/ /g' -e s'/)//g' tempfile01 | sort > tempfile02
grep -v 'xlibs$\|^xlibs \|^libgl1$\|^libgl1 \|^libglu1$\|^libglu1 \|^default-jre$\|^default-jre \|^openjdk-[0-9]+-[jdk|jre]\|^python:any$\|^python:any \|^libpango\|^libcupsys2$\|^libcupsys2 \|^fonts-freefont-ttf$\|^fonts-freefont-ttf \|^fonts-liberation$\|^fonts-liberation \|^ttf-mscorefonts-installer$\|^ttf-mscorefonts-installer \|^dpkg$\|^dpkg \|^apt$\|^apt \|^apt-get$\|^apt-get \|^aptitude$\|^aptitude \|^debconf' tempfile02 > conflicts-initial-check-list
grep -v 'xlibs$\|^xlibs \|^libgl1$\|^libgl1 \|^libglu1$\|^libglu1 \|^default-jre$\|^default-jre \|^openjdk-[0-9]+-[jdk|jre]\|^libstdc[0-9]+$\|^libstdc[0-9]+ \|^qt[0-9]+-default$\|^qt[0-9]+-default \|^python:any$\|^python:any \|^libpango\|^libcupsys2$\|^libcupsys2 \|^jackd[0-9]*$\|^jackd[0-9]* \|^fonts-freefont-ttf$\|^fonts-freefont-ttf \|^fonts-liberation$\|^fonts-liberation \|^ttf-mscorefonts-installer$\|^ttf-mscorefonts-installer \|^dpkg$\|^dpkg \|^apt$\|^apt \|^apt-get$\|^apt-get \|^aptitude$\|^aptitude \|^debconf' tempfile02 > conflicts-initial-check-list
packages-names-translator
if [[ $wipeout != set ]]; then
for i in `sort -u tempfile22`; do echo "conflict = $i" >> .PKGINFO; done
else
for i in `sort -u tempfile18`; do echo "conflict = $i" >> .PKGINFO; done
for i in `sort -u tempfile18`; do echo "conflict = $i" >> .PKGINFO; done
fi
rm -rf *tempfile* conflicts-initial-check-list final-check-list
rm -rf *tempfile* conflicts-initial-check-list final-check-list
fi
# Generating provisions fields
if [[ $(grep -q ^Provides: control; echo $?) == 0 ]]; then
grep ^Provides: control | sed -e s'/^Provides: //g' -e s'/ (/(/g' -e s'/= /=/g' -e s'/>> />/g' -e s'/<< /</g' -e s'/|/ /g' | tr -d "," | while read line; do
grep -i ^Provides: control | sed -e s'/^Provides://g' -e s'/^ //g' -e s'/ (/(/g' -e s'/= /=/g' -e s'/>> />/g' -e s'/<< /</g' -e s'/,\||/ /g' -e s'/ / /g' | while read line; do
for word in $line; do
echo $word >> tempfile01
done
done
sed -e s'/(/ /g' -e s'/)//g' tempfile01 | sort > tempfile02
grep -v 'xlibs$\|^xlibs \|^libgl1$\|^libgl1 \|^libglu1$\|^libglu1 \|^default-jre$\|^default-jre \|^openjdk-[0-9]+-[jdk|jre]\|^python:any$\|^python:any \|^libpango\|^libcupsys2$\|^libcupsys2 \|^fonts-freefont-ttf$\|^fonts-freefont-ttf \|^fonts-liberation$\|^fonts-liberation \|^ttf-mscorefonts-installer$\|^ttf-mscorefonts-installer \|^dpkg$\|^dpkg \|^apt$\|^apt \|^apt-get$\|^apt-get \|^aptitude$\|^aptitude \|^debconf' tempfile02 > provisions-initial-check-list
grep -v 'xlibs$\|^xlibs \|^libgl1$\|^libgl1 \|^libglu1$\|^libglu1 \|^default-jre$\|^default-jre \|^openjdk-[0-9]+-[jdk|jre]\|^libstdc[0-9]+$\|^libstdc[0-9]+ \|^qt[0-9]+-default$\|^qt[0-9]+-default \|^python:any$\|^python:any \|^libpango\|^libcupsys2$\|^libcupsys2 \|^jackd[0-9]*$\|^jackd[0-9]* \|^fonts-freefont-ttf$\|^fonts-freefont-ttf \|^fonts-liberation$\|^fonts-liberation \|^ttf-mscorefonts-installer$\|^ttf-mscorefonts-installer \|^dpkg$\|^dpkg \|^apt$\|^apt \|^apt-get$\|^apt-get \|^aptitude$\|^aptitude \|^debconf' tempfile02 > provisions-initial-check-list
packages-names-translator
if [[ $wipeout != set ]] && [[ $pkgbuild != set ]] && [[ $Pkgbuild != set ]]; then
for i in `sort -u tempfile22`; do echo "provides = $i" >> .PKGINFO; done
@ -2865,7 +2883,7 @@ fi
if [[ -e conffiles ]]; then
sed s'/^\///g' conffiles > tempfile
if [[ $pseudo != set ]]; then
if [[ $(grep ^Architecture: control | grep -q i386; echo $?) == 0 ]]; then
if [[ $(grep -i ^Architecture: control | grep -q i386; echo $?) == 0 ]]; then
sed -i -e s'/^bin\//usr\/bin\//g' -e s'/^sbin\//usr\/bin\//g' -e s'/^usr\/sbin\//usr\/bin\//g' -e s'/^usr\/games\//usr\/bin\//g' -e s'/^lib\//usr\/lib\//g' -e s'/^lib32\//usr\/lib\//g' -e s'/^usr\/lib32\//usr\/lib\//g' -e s'/^usr\/local\/sbin\//usr\/bin\//g' -e s'/^usr\/local\/games\//usr\/bin\//g' -e s'/^usr\/local\/lib32\//usr\/lib\//g' -e s'/^usr\/local\//usr\//g' tempfile
else
sed -i -e s'/^bin\//usr\/bin\//g' -e s'/^sbin\//usr\/bin\//g' -e s'/^usr\/sbin\//usr\/bin\//g' -e s'/^usr\/games\//usr\/bin\//g' -e s'/^lib\//usr\/lib\//g' -e s'/^lib32\//usr\/lib32\//g' -e s'/^lib64\//usr\/lib\//g' -e s'/^usr\/lib64\//usr\/lib\//g' -e s'/^usr\/local\/sbin\//usr\/bin\//g' -e s'/^usr\/local\/games\//usr\/bin\//g' -e s'/^usr\/local\/lib64\//usr\/lib\//g' -e s'/^usr\/local\//usr\//g' tempfile
@ -2874,36 +2892,36 @@ if [[ -e conffiles ]]; then
sed -i -e s'/^bin\//usr\/bin\//g' -e s'/^sbin\//usr\/bin\//g' -e s'/^usr\/sbin\//usr\/bin\//g' -e s'/^usr\/games\//usr\/bin\//g' -e s'/^lib\//usr\/lib32\//g' -e s'/^lib32\//usr\/lib32\//g' -e s'/^usr\/lib\//usr\/lib32\//g' -e s'/^usr\/local\/sbin\//usr\/bin\//g' -e s'/^usr\/local\/games\//usr\/bin\//g' -e s'/^usr\/local\/lib\//usr\/lib32\//g' -e s'/^usr\/local\//usr\//g' tempfile
fi
for i in `sort -u tempfile`; do echo "backup = $i" >> .PKGINFO; done
rm -rf tempfile
rm -rf tempfile
fi
# Generating non optional dependencies fields
if [[ $(grep -q '^Depends:\|^Pre-Depends:' control; echo $?) == 0 ]]; then
grep '^Depends:\|^Pre-Depends:' control | sed -e s'/^Depends: \|^Pre-Depends: //g' -e s'/ (/(/g' -e s'/= /=/g' -e s'/>> />/g' -e s'/<< /</g' -e s'/|/ /g' | tr -d "," | while read line; do
grep '^Depends:\|^Pre-Depends:' control | sed -e s'/^Pre-Depends://g' -e s'/^Depends://g' -e s'/^ //g' -e s'/ (/(/g' -e s'/= /=/g' -e s'/>> />/g' -e s'/<< /</g' -e s'/,\||/ /g' -e s'/ / /g' | while read line; do
for word in $line; do
echo $word >> tempfile01
done
done
sed -e s'/(/ /g' -e s'/)//g' tempfile01 | sort > tempfile02
grep -v 'xlibs$\|^xlibs \|^libgl1$\|^libgl1 \|^libglu1$\|^libglu1 \|^default-jre$\|^default-jre \|^openjdk-[0-9]+-[jdk|jre]\|^python:any$\|^python:any \|^libpango\|^libcupsys2$\|^libcupsys2 \|^fonts-freefont-ttf$\|^fonts-freefont-ttf \|^fonts-liberation$\|^fonts-liberation \|^ttf-mscorefonts-installer$\|^ttf-mscorefonts-installer \|^dpkg$\|^dpkg \|^apt$\|^apt \|^apt-get$\|^apt-get \|^aptitude$\|^aptitude \|^debconf' tempfile02 > dependencies-initial-check-list
grep -v 'xlibs$\|^xlibs \|^libgl1$\|^libgl1 \|^libglu1$\|^libglu1 \|^default-jre$\|^default-jre \|^openjdk-[0-9]+-[jdk|jre]\|^libstdc[0-9]+$\|^libstdc[0-9]+ \|^qt[0-9]+-default$\|^qt[0-9]+-default \|^python:any$\|^python:any \|^libpango\|^libcupsys2$\|^libcupsys2 \|^jackd[0-9]*$\|^jackd[0-9]* \|^fonts-freefont-ttf$\|^fonts-freefont-ttf \|^fonts-liberation$\|^fonts-liberation \|^ttf-mscorefonts-installer$\|^ttf-mscorefonts-installer \|^dpkg$\|^dpkg \|^apt$\|^apt \|^apt-get$\|^apt-get \|^aptitude$\|^aptitude \|^debconf' tempfile02 > dependencies-initial-check-list
packages-names-translator
if [[ $wipeout != set ]]; then
for i in `sort -u tempfile22`; do echo "depend = $i" >> .PKGINFO; done
else
for i in `sort -u tempfile18`; do echo "depend = $i" >> .PKGINFO; done
for i in `sort -u tempfile18`; do echo "depend = $i" >> .PKGINFO; done
fi
rm -rf *tempfile* dependencies-initial-check-list final-check-list
rm -rf *tempfile* dependencies-initial-check-list final-check-list
fi
# Generating optional dependencies fields
if [[ $(grep -q '^Recommends:\|^Suggests:' control; echo $?) == 0 ]]; then
grep '^Recommends:\|^Suggests:' control | sed -e s'/^Recommends: \|^Suggests: //g' -e s'/ (/(/g' -e s'/= /=/g' -e s'/>> />/g' -e s'/<< /</g' -e s'/|/ /g' | tr -d "," | while read line; do
grep '^Recommends:\|^Suggests:' control | sed -e s'/^Recommends:\|^Suggests://g' -e s'/^ //g' -e s'/ (/(/g' -e s'/= /=/g' -e s'/>> />/g' -e s'/<< /</g' -e s'/,\||/ /g' -e s'/ / /g' | while read line; do
for word in $line; do
echo $word >> tempfile01
done
done
sed -e s'/(/ /g' -e s'/)//g' tempfile01 | sort > tempfile02
grep -v 'xlibs$\|^xlibs \|^libgl1$\|^libgl1 \|^libglu1$\|^libglu1 \|^default-jre$\|^default-jre \|^openjdk-[0-9]+-[jdk|jre]\|^python:any$\|^python:any \|^libpango\|^libcupsys2$\|^libcupsys2 \|^fonts-freefont-ttf$\|^fonts-freefont-ttf \|^fonts-liberation$\|^fonts-liberation \|^ttf-mscorefonts-installer$\|^ttf-mscorefonts-installer \|^dpkg$\|^dpkg \|^apt$\|^apt \|^apt-get$\|^apt-get \|^aptitude$\|^aptitude \|^debconf' tempfile02 > optional-dependencies-initial-check-list
grep -v 'xlibs$\|^xlibs \|^libgl1$\|^libgl1 \|^libglu1$\|^libglu1 \|^default-jre$\|^default-jre \|^openjdk-[0-9]+-[jdk|jre]\|^libstdc[0-9]+$\|^libstdc[0-9]+ \|^qt[0-9]+-default$\|^qt[0-9]+-default \|^python:any$\|^python:any \|^libpango\|^libcupsys2$\|^libcupsys2 \|^jackd[0-9]*$\|^jackd[0-9]* \|^fonts-freefont-ttf$\|^fonts-freefont-ttf \|^fonts-liberation$\|^fonts-liberation \|^ttf-mscorefonts-installer$\|^ttf-mscorefonts-installer \|^dpkg$\|^dpkg \|^apt$\|^apt \|^apt-get$\|^apt-get \|^aptitude$\|^aptitude \|^debconf' tempfile02 > optional-dependencies-initial-check-list
packages-names-translator
if [[ $wipeout != set ]]; then
for i in `sort -u tempfile22`; do
@ -2919,7 +2937,7 @@ if [[ $(grep -q '^Recommends:\|^Suggests:' control; echo $?) == 0 ]]; then
fi
done
fi
rm -rf *tempfile* optional-dependencies-initial-check-list final-check-list
rm -rf *tempfile* optional-dependencies-initial-check-list final-check-list
fi
# Moving report files to /tmp/debtap (if any exist)
@ -2978,7 +2996,6 @@ if [[ -e /tmp/debtap/provisions-untranslated-names-only ]]; then
fi
# Generating .INSTALL file (if necessary)
# Array search utility function
echo -e "\n${lightgreen}==>${NC} ${bold}Checking and generating .INSTALL file (if necessary)...${normal}"
SAVEIFS=$IFS
@ -2992,8 +3009,8 @@ if [[ -e preinst ]]; then
sed -i -e '/.*upgrade.*)[[:blank:]]\{0,\}$/d' -e '/.*install.*)[[:blank:]]\{0,\}$/d' -e '/^[[:blank:]]\{0,\};;[[:blank:]]\{0,\}$/d' -e '/^[[:blank:]]\{0,\}exit 0[[:blank:]]\{0,\}$/d' -e '/^[[:blank:]]\{0,\}exit[[:blank:]]\{0,\}$/d' preinst
sed -i -e s'/.*\*)[[:blank:]]{0,\}\(.*\)/\1/g' -e s'/.*upgrade.*)[[:blank:]]\{0,\}\(.*\)$/\1/g' -e s'/.*install.*)[[:blank:]]\{0,\}\(.*\)$/\1/g' -e s'/^[[:blank:]]\{0,\};;[[:blank:]]\{0,\}\(.*\)$/\1/g' -e s'/^\(.*\)[[:blank:]]\{0,\}\(; \)\{0,1\}\( && \)\{0,1\}[[:blank:]]\{0,\}exit 0[[:blank:]]\{0,\}$/\1/g' -e s'/^\(.*\)[[:blank:]]\{0,\}\(; \)\{0,1\}\( && \)\{0,1\}[[:blank:]]\{0,\}exit[[:blank:]]\{0,\}$/\1/g' preinst
fi
grep -iv '#!\|set -e\|automatically\|added\|generated\|debian-policy\|debconf\|dh_installdeb\|debhelper\|preinst\|postinst\|prerm\|postrm\|abort\|update-alternatives\|--slave\|db_\|remove_source\|update_manager\|lintian' preinst | while read -r line; do
echo -e "\t$line" >> tempfile1
grep -iv '#!\|set -e\|automatically\|added\|generated\|apt \|apt-get \|aptitude \|debian-policy\|debconf\|dh_installdeb\|debhelper\|preinst\|postinst\|prerm\|postrm\|update-alternatives\|--slave\|db_\|remove_source\|update_manager\|lintian' preinst | while read -r line; do
printf '\t%s\n' "$line" >> tempfile1
done
fi
echo "}" >> tempfile1
@ -3015,8 +3032,8 @@ if [[ -e postinst ]]; then
sed -i -e '/.*configure.*)[[:blank:]]\{0,\}$/d' -e '/^[[:blank:]]\{0,\};;[[:blank:]]\{0,\}$/d' -e '/^[[:blank:]]\{0,\}exit 0[[:blank:]]\{0,\}$/d' -e '/^[[:blank:]]\{0,\}exit[[:blank:]]\{0,\}$/d' postinst
sed -i -e s'/.*\*)[[:blank:]]{0,\}\(.*\)/\1/g' -e s'/.*configure.*)[[:blank:]]\{0,\}\(.*\)$/\1/g' -e s'/^[[:blank:]]\{0,\};;[[:blank:]]\{0,\}\(.*\)$/\1/g' -e s'/^\(.*\)[[:blank:]]\{0,\}\(; \)\{0,1\}\( && \)\{0,1\}[[:blank:]]\{0,\}exit 0[[:blank:]]\{0,\}$/\1/g' -e s'/^\(.*\)[[:blank:]]\{0,\}\(; \)\{0,1\}\( && \)\{0,1\}[[:blank:]]\{0,\}exit[[:blank:]]\{0,\}$/\1/g' postinst
fi
grep -iv '#!\|set -e\|automatically\|added\|generated\|debian-policy\|debconf\|dh_installdeb\|debhelper\|preinst\|postinst\|prerm\|postrm\|abort\|update-alternative\|--slave\|db_\|remove_source\|update_manager\|lintian' postinst | while read -r line; do
echo -e "\t$line" >> tempfile1
grep -iv '#!\|set -e\|automatically\|added\|generated\|apt \|apt-get \|aptitude \|debian-policy\|debconf\|dh_installdeb\|debhelper\|preinst\|postinst\|prerm\|postrm\|update-alternative\|--slave\|db_\|remove_source\|update_manager\|lintian' postinst | while read -r line; do
printf '\t%s\n' "$line" >> tempfile1
done
fi
if [[ $(grep '^depend' .PKGINFO | grep -q 'qt\|gtk'; echo $?) == 0 ]]; then
@ -3027,13 +3044,13 @@ if [[ $(echo $(($(grep "[[:blank:]]" -o tempfile1 | wc -l) + 16))) != $(echo $((
cat tempfile1 >> tempfile2
fi
if [[ $(grep -q '^pre_install() {$' tempfile2; echo $?) == 0 ]]; then
if [[ $(grep -q '^pre_install() {$' tempfile2 2> /dev/null; echo $?) == 0 ]]; then
echo -e "\npre_upgrade() {" >> tempfile2
echo -e "\tpre_install" >> tempfile2
echo "}" >> tempfile2
fi
if [[ $(grep -q '^post_install() {$' tempfile2; echo $?) == 0 ]]; then
if [[ $(grep -q '^post_install() {$' tempfile2 2> /dev/null; echo $?) == 0 ]]; then
echo -e "\npost_upgrade() {" >> tempfile2
echo -e "\tpost_install" >> tempfile2
echo "}" >> tempfile2
@ -3048,8 +3065,8 @@ if [[ -e prerm ]]; then
sed -i -e '/.*remove.*)[[:blank:]]\{0,\}$/d' -e '/.*upgrade.*)[[:blank:]]\{0,\}$/d' -e '/^[[:blank:]]\{0,\};;[[:blank:]]\{0,\}$/d' -e '/^[[:blank:]]\{0,\}exit 0[[:blank:]]\{0,\}$/d' -e '/^[[:blank:]]\{0,\}exit[[:blank:]]\{0,\}$/d' prerm
sed -i -e s'/.*\*)[[:blank:]]{0,\}\(.*\)/\1/g' -e s'/.*remove.*)[[:blank:]]\{0,\}\(.*\)$/\1/g' -e s'/.*upgrade.*)[[:blank:]]\{0,\}\(.*\)$/\1/g' -e s'/^[[:blank:]]\{0,\};;[[:blank:]]\{0,\}\(.*\)$/\1/g' -e s'/^\(.*\)[[:blank:]]\{0,\}\(; \)\{0,1\}\( && \)\{0,1\}[[:blank:]]\{0,\}exit 0[[:blank:]]\{0,\}$/\1/g' -e s'/^\(.*\)[[:blank:]]\{0,\}\(; \)\{0,1\}\( && \)\{0,1\}[[:blank:]]\{0,\}exit[[:blank:]]\{0,\}$/\1/g' prerm
fi
grep -iv '#!\|set -e\|automatically\|added\|generated\|debian-policy\|debconf\|dh_installdeb\|debhelper\|preinst\|postinst\|prerm\|postrm\|abort\|update-alternatives\|--slave\|db_\|remove_source\|update_manager\|lintian' prerm | while read -r line; do
echo -e "\t$line" >> tempfile1
grep -iv '#!\|set -e\|automatically\|added\|generated\|apt \|apt-get \|aptitude \|debian-policy\|debconf\|dh_installdeb\|debhelper\|preinst\|postinst\|prerm\|postrm\|update-alternatives\|--slave\|db_\|remove_source\|update_manager\|lintian' prerm | while read -r line; do
printf '\t%s\n' "$line" >> tempfile1
done
fi
echo "}" >> tempfile1
@ -3066,13 +3083,13 @@ fi
if [[ -e postrm ]]; then
sed -i -e '/how this script works/,/debian-policy/d' -e '/how this script works/,/version>/d' -e '/dh_installdeb/,/DEBHELPER/d' postrm
if [[ $(grep -c "case in \$1\|case in \${1}\|case in \"\$1\"\|case in \"\${1}\"\|case \$1 in\|case \${1} in\|case \"\$1\" in\|case \"\${1}\" in" postrm) == $(grep -c "case " postrm) ]]; then
sed -i -e '/case in \$1/,/remove/{/remove/!d}' -e '/case in {1}/,/remove/{/remove/!d}' -e '/case in "\$1"/,/remove/{/remove/!d}' -e '/case in "{1}"/,/remove/{/remove/!d}' -e '/case \$1 in/,/remove/{/remove/!d}' -e '/case {1} in/,/remove/{/remove/!d}' -e '/case "\$1" in/,/remove/{/remove/!d}' -e '/case "{1}" in/,/remove/{/remove/!d}' -e '/case in \$1/,/purge/{/purge/!d}' -e '/case in {1}/,/purge/{/purge/!d}' -e '/case in "\$1"/,/purge/{/purge/!d}' -e '/case in "{1}"/,/purge/{/purge/!d}' -e '/case \$1 in/,/purge/{/purge/!d}' -e '/case {1} in/,/purge/{/purge/!d}' -e '/case "\$1" in/,/purge/{/purge/!d}' -e '/case "{1}" in/,/purge/{/purge/!d}' -e '/case in \$1/,/upgrade/{/upgrade/!d}' -e '/case in \${1}/,/upgrade/{/upgrade/!d}' -e '/case in "\$1"/,/upgrade/{/upgrade/!d}' -e '/case in "\${1}"/,/upgrade/{/upgrade/!d}' -e '/case \$1 in/,/upgrade/{/upgrade/!d}' -e '/case \${1} in/,/upgrade/{/upgrade/!d}' -e '/case "\$1" in/,/upgrade/{/upgrade/!d}' -e '/case "\${1}" in/,/upgrade/{/upgrade/!d}' -e '/case in \$1/,/update-alternatives/{/update-alternatives/!d}' -e '/case in {1}/,/update-alternatives/{/update-alternatives/!d}' -e '/case in "\$1"/,/update-alternatives/{/update-alternatives/!d}' -e '/case in "{1}"/,/update-alternatives/{/update-alternatives/!d}' -e '/case \$1 in/,/update-alternatives/{/update-alternatives/!d}' -e '/case {1} in/,/update-alternatives/{/upda..te-alternatives/!d}' -e '/case "\$1" in/,/update-alternatives/{/update-alternatives/!d}' -e '/case "{1}" in/,/update-alternatives/{/update-alternatives/!d}' -e '/case in \$1/,/db_/{/db_/!d}' -e '/case in {1}/,/db_/{/db_/!d}' -e '/case in "\$1"/,/db_/{/db_/!d}' -e '/case in "{1}"/,/db_/{/db_/!d}' -e '/case \$1 in/,/db_/{/db_/!d}' -e '/case {1} in/,/db_/{/db_/!d}' -e '/case "\$1" in/,/db_/{/db_/!d}' -e '/case "{1}" in/,/db_/{/db_/!d}' -e '/;;/,/esac/{/;;/!d}' postrm
sed -i -e '/case in \$1/,/remove/{/remove/!d}' -e '/case in {1}/,/remove/{/remove/!d}' -e '/case in "\$1"/,/remove/{/remove/!d}' -e '/case in "{1}"/,/remove/{/remove/!d}' -e '/case \$1 in/,/remove/{/remove/!d}' -e '/case {1} in/,/remove/{/remove/!d}' -e '/case "\$1" in/,/remove/{/remove/!d}' -e '/case "{1}" in/,/remove/{/remove/!d}' -e '/case in \$1/,/purge/{/purge/!d}' -e '/case in {1}/,/purge/{/purge/!d}' -e '/case in "\$1"/,/purge/{/purge/!d}' -e '/case in "{1}"/,/purge/{/purge/!d}' -e '/case \$1 in/,/purge/{/purge/!d}' -e '/case {1} in/,/purge/{/purge/!d}' -e '/case "\$1" in/,/purge/{/purge/!d}' -e '/case "{1}" in/,/purge/{/purge/!d}' -e '/case in \$1/,/upgrade/{/upgrade/!d}' -e '/case in \${1}/,/upgrade/{/upgrade/!d}' -e '/case in "\$1"/,/upgrade/{/upgrade/!d}' -e '/case in "\${1}"/,/upgrade/{/upgrade/!d}' -e '/case \$1 in/,/upgrade/{/upgrade/!d}' -e '/case \${1} in/,/upgrade/{/upgrade/!d}' -e '/case "\$1" in/,/upgrade/{/upgrade/!d}' -e '/case "\${1}" in/,/upgrade/{/upgrade/!d}' -e '/case in \$1/,/update-alternatives/{/update-alternatives/!d}' -e '/case in {1}/,/update-alternatives/{/update-alternatives/!d}' -e '/case in "\$1"/,/update-alternatives/{/update-alternatives/!d}' -e '/case in "{1}"/,/update-alternatives/{/update-alternatives/!d}' -e '/case \$1 in/,/update-alternatives/{/update-alternatives/!d}' -e '/case {1} in/,/update-alternatives/{/updaste-alternatives/!d}' -e '/case "\$1" in/,/update-alternatives/{/update-alternatives/!d}' -e '/case "{1}" in/,/update-alternatives/{/update-alternatives/!d}' -e '/case in \$1/,/db_/{/db_/!d}' -e '/case in {1}/,/db_/{/db_/!d}' -e '/case in "\$1"/,/db_/{/db_/!d}' -e '/case in "{1}"/,/db_/{/db_/!d}' -e '/case \$1 in/,/db_/{/db_/!d}' -e '/case {1} in/,/db_/{/db_/!d}' -e '/case "\$1" in/,/db_/{/db_/!d}' -e '/case "{1}" in/,/db_/{/db_/!d}' -e '/;;/,/esac/{/;;/!d}' postrm
sed -i -e '/[[:blank:]]\{0,\}update-alternatives.*)/,/esac/d' -e '/[[:blank:]]\{0,\}db_.*)/,/esac/d' -e '/[[:blank:]]\{0,\}db_.*)/,/update-alternatives/d' -e '/[[:blank:]]\{0,\}lintian.*/,/}/d' -e '/[[:blank:]]\{0,\}if.*update-app-install.*/,/fi/d' -e '/[[:blank:]]\{0,\}if.*update-software-center.*/,/fi/d' -e '/[[:blank:]]\{0,\}if.*RET.*/,/fi/d' -e '/.*\*)[[:blank:]]\{0,\}/,/esac/d' postrm
sed -i -e '/.*remove.*)[[:blank:]]\{0,\}$/d' -e '/.*purge.*)[[:blank:]]\{0,\}$/d' -e '/.*upgrade.*)[[:blank:]]\{0,\}$/d' -e '/^[[:blank:]]\{0,\};;[[:blank:]]\{0,\}$/d' -e '/^[[:blank:]]\{0,\}exit 0[[:blank:]]\{0,\}$/d' -e '/^[[:blank:]]\{0,\}exit[[:blank:]]\{0,\}$/d' postrm
sed -i -e s'/.*\*)[[:blank:]]{0,\}\(.*\)/\1,/g' -e s'/.*remove.*)[[:blank:]]\{0,\}\(.*\)$/\1/g' -e s'/.*purge.*)[[:blank:]]\{0,\}\(.*\)$/\1/g' -e s'/.*upgrade.*)[[:blank:]]\{0,\}\(.*\)$/\1/g' -e s'/^[[:blank:]]\{0,\};;[[:blank:]]\{0,\}\(.*\)$/\1/g' -e s'/^\(.*\)[[:blank:]]\{0,\}\(; \)\{0,1\}\( && \)\{0,1\}[[:blank:]]\{0,\}exit 0[[:blank:]]\{0,\}$/\1/g' -e s'/^\(.*\)[[:blank:]]\{0,\}\(; \)\{0,1\}\( && \)\{0,1\}[[:blank:]]\{0,\}exit[[:blank:]]\{0,\}$/\1/g' postrm
fi
grep -iv '#!\|set -e\|automatically\|added\|generated\|debian-policy\|debconf\|dh_installdeb\|debhelper\|preinst\|postinst\|prerm\|postrm\|abort\|update-alternatives\|--slave\|db_\|remove_source\|update_manager\|lintian' postrm | while read -r line; do
echo -e "\t$line" >> tempfile1
grep -iv '#!\|set -e\|automatically\|added\|generated\|apt \|apt-get \|aptitude \|debian-policy\|debconf\|dh_installdeb\|debhelper\|preinst\|postinst\|prerm\|postrm\|update-alternatives\|--slave\|db_\|remove_source\|update_manager\|lintian' postrm | while read -r line; do
printf '\t%s\n' "$line" >> tempfile1
done
fi
if [[ $(grep '^depend' .PKGINFO | grep -q 'qt\|gtk'; echo $?) == 0 ]]; then
@ -3092,7 +3109,7 @@ if [[ -e tempfile2 ]]; then
sed -i s'/^[[:blank:]]\{1,\}$//g' tempfile2
if [[ $pseudo != set ]]; then
if [[ $(grep ^Architecture: control \| grep -q i386; echo $?) == 0 ]]; then
if [[ $(grep -i ^Architecture: control \| grep -q i386; echo $?) == 0 ]]; then
sed -i -e s'/ \/bin\// \/usr\/bin\//g' -e s'/ \/sbin\// \/usr\/bin\//g' -e s'/ \/usr\/sbin\// \/usr\/bin\//g' -e s'/ \/usr\/games\// \/usr\/bin\//g' -e s'/ \/lib\// \/usr\/lib\//g' -e s'/ \/lib32\// \/usr\/lib\//g' -e s'/ \/usr\/lib32\// \/usr\/lib\//g' -e s'/ \/usr\/local\/sbin\// \/usr\/bin\//g' -e s'/ \/usr\/local\/games\// \/usr\/bin\//g' -e s'/ \/usr\/local\/lib32\// \/usr\/lib\//g' -e s'/ \/usr\/local\// \/usr\//g' tempfile2
sed -i -e s'/=\/bin\//=\/usr\/bin\//g' -e s'/=\/sbin\//=\/usr\/bin\//g' -e s'/=\/usr\/sbin\//=\/usr\/bin\//g' -e s'/=\/usr\/games\//=\/usr\/bin\//g' -e s'/=\/lib\//=\/usr\/lib\//g' -e s'/=\/lib32\//=\/usr\/lib\//g' -e s'/=\/usr\/lib32\//=\/usr\/lib\//g' -e s'/=\/usr\/local\/sbin\//=\/usr\/bin\//g' -e s'/=\/usr\/local\/games\//=\/usr\/bin\//g' -e s'/=\/usr\/local\/lib32\//=\/usr\/lib\//g' -e s'/=\/usr\/local\//=\/usr\//g' tempfile2
sed -i -e s'/>\/bin\//>\/usr\/bin\//g' -e s'/>\/sbin\//>\/usr\/bin\//g' -e s'/>\/usr\/sbin\//>\/usr\/bin\//g' -e s'/>\/usr\/games\//>\/usr\/bin\//g' -e s'/>\/lib\//>\/usr\/lib\//g' -e s'/>\/lib32\//>\/usr\/lib\//g' -e s'/>\/usr\/lib32\//>\/usr\/lib\//g' -e s'/>\/usr\/local\/sbin\//>\/usr\/bin\//g' -e s'/>\/usr\/local\/games\//>\/usr\/bin\//g' -e s'/>\/usr\/local\/lib32\//>\/usr\/lib\//g' -e s'/>\/usr\/local\//>\/usr\//g' tempfile2
@ -3175,9 +3192,9 @@ if [[ $Pkgbuild != set ]]; then
echo -e "\n${lightgreen}==>${NC} ${bold}Creating final package...${normal}"
fakeroot << EOF
tar --force-local -pcf `grep '^pkgname =' .PKGINFO | gawk '{print $3}'`-`grep '^pkgver =' .PKGINFO | gawk '{print $3}'`-`grep '^arch =' .PKGINFO | gawk '{print $3}'`.pkg.tar --exclude='pkgbuildinstallations*' * .PKGINFO .INSTALL .MTREE 2> /dev/null
xz --threads=0 -z -9 *.tar
zstd -q -T0 --ultra -20 *.tar
EOF
mv *.xz "$(dirname "$package_with_full_path")"
mv *.zst "$(dirname "$package_with_full_path")"
fi
# Announcement of successful creation of package
@ -3188,7 +3205,6 @@ fi
if [[ $pkgbuild != set ]] && [[ $Pkgbuild != set ]]; then
# Removing leftover files
echo -e "${lightgreen}==>${NC} ${bold}Removing leftover files...${normal}"
cd ..
rm -rf "$working_directory"
rm -rf /tmp/debtap
exit 0
@ -3204,7 +3220,7 @@ else
echo "# Maintainer: $(grep '^packager =' .PKGINFO | gawk '{print $3}')" >> PKGBUILD
echo "# Contributor: $(grep '^packager =' .PKGINFO | gawk '{print $3}')" >> PKGBUILD
fi
if [[ $(grep -q '^pkgname = lib32-' .PKGINFO; echo $?) != 0 ]] && [[ $(grep '^pkgname =' .PKGINFO | grep -q -- '-multilib$'; echo $?) != 0 ]] && [[ $(ls -A usr/bin) ]]; then
if [[ $(grep -q '^pkgname = lib32-' .PKGINFO; echo $?) != 0 ]] && [[ $(grep '^pkgname =' .PKGINFO | grep -q -- '-multilib$'; echo $?) != 0 ]] && [[ $(ls -A usr/bin 2> /dev/null) ]]; then
echo "$(grep '^pkgname =' .PKGINFO | sed s'/ //g')-bin" >> PKGBUILD
else
echo "$(grep '^pkgname =' .PKGINFO | sed s'/ //g')" >> PKGBUILD
@ -3316,61 +3332,51 @@ else
echo "sha512sums=('$(sha512sum "$package_with_full_path" | gawk '{print $1}')')" >> PKGBUILD
fi
echo -e "\npackage(){\n\n # Extract package data" >> PKGBUILD
if [[ $data_tar_check == data.tar.gz ]]; then
echo " tar xzf data.tar.gz -C \"\${pkgdir}\"" >> PKGBUILD
elif [[ $data_tar_check == data.tar.xz ]]; then
echo " tar xf data.tar.xz -C \"\${pkgdir}\"" >> PKGBUILD
elif [[ $data_tar_check == data.tar.bz2 ]]; then
echo " tar xf data.tar.bz2 -C \"\${pkgdir}\"" >> PKGBUILD
elif [[ $data_tar_check == data.tar.lzma ]]; then
echo " tar xf data.tar.lzma -C \"\${pkgdir}\"" >> PKGBUILD
elif [[ $data_tar_check == data.tar ]]; then
echo " tar xf data.tar -C \"\${pkgdir}\"" >> PKGBUILD
fi
echo " $data_extract -f $data_tar_check -C \"\${pkgdir}\"" >> PKGBUILD
if [[ -e pkgbuildinstallations1 ]] || [[ -e pkgbuildinstallations2 ]] || [[ -e pkgbuildinstallations32 ]] || [[ -e pkgbuildinstallations64 ]]; then
if [[ $(grep '^install' pkgbuildinstallations1 2> /dev/null | wc -l) != $(echo $(($(cat pkgbuildinstallations1 2> /dev/null | wc -l) + $(cat pkgbuildinstallations2 2> /dev/null | wc -l) + $(cat pkgbuildinstallations32 2> /dev/null | wc -l) + $(cat pkgbuildinstallations64 2> /dev/null | wc -l)))) ]]; then
echo -e "\n # Fix directories structure differencies\n cd \"\${pkgdir}\"" >> PKGBUILD
echo -e "\n # Fix directory structure differences\n cd \"\${pkgdir}\"" >> PKGBUILD
fi
fi
if [[ -e pkgbuildinstallations1 ]]; then
echo >> PKGBUILD
cat pkgbuildinstallations1 | while read line; do
cat pkgbuildinstallations1 | while read -r line; do
echo -e " $line" >> PKGBUILD
done
fi
if [[ $(grep -q "^arch=('i686' 'x86_64')$" PKGBUILD; echo $?) == 0 ]]; then
if [[ -e pkgbuildinstallations32 ]] && [[ -e pkgbuildinstallations64 ]]; then
echo -e "\n if [[ \${CARCH} == i686 ]]; then" >> PKGBUILD
cat pkgbuildinstallations32 | while read line; do
cat pkgbuildinstallations32 | while read -r line; do
echo " $line" >> PKGBUILD
done
echo " elif [[ \${CARCH} == x86_64 ]]; then" >> PKGBUILD
cat pkgbuildinstallations64 | while read line; do
cat pkgbuildinstallations64 | while read -r line; do
echo " $line" >> PKGBUILD
done
echo " fi" >> PKGBUILD
elif [[ -e pkgbuildinstallations32 ]] && [[ ! -e pkgbuildinstallations64 ]]; then
echo -e "\n if [[ \${CARCH} == i686 ]]; then" >> PKGBUILD
cat pkgbuildinstallations32 | while read line; do
cat pkgbuildinstallations32 | while read -r line; do
echo " $line" >> PKGBUILD
done
echo " fi" >> PKGBUILD
elif [[ ! -e pkgbuildinstallations32 ]] && [[ -e pkgbuildinstallations64 ]]; then
echo -e "\n if [[ \${CARCH} == x86_64 ]]; then" >> PKGBUILD
cat pkgbuildinstallations64 | while read line; do
cat pkgbuildinstallations64 | while read -r line; do
echo " $line" >> PKGBUILD
done
echo " fi" >> PKGBUILD
fi
elif [[ $(grep -q "^arch=('x86_64')$" PKGBUILD; echo $?) == 0 ]] && [[ -e pkgbuildinstallations64 ]]; then
echo >> PKGBUILD
cat pkgbuildinstallations64 | while read line; do
cat pkgbuildinstallations64 | while read -r line; do
echo -e " $line" >> PKGBUILD
done
fi
if [[ -e pkgbuildinstallations2 ]]; then
echo >> PKGBUILD
cat pkgbuildinstallations2 | while read line; do
cat pkgbuildinstallations2 | while read -r line; do
echo -e " $line" >> PKGBUILD
done
fi
@ -3387,7 +3393,6 @@ rm -rf "../$pkgname" 2> /dev/null
mkdir "../$pkgname" 2> /dev/null
if [[ $(echo $?) != 0 ]]; then
echo -e "${red}Error: Cannot create PKGBUILD directory, permission denied. Removing leftover files and exiting...${NC}"
cd ..
rm -rf "$working_directory"
rm -rf /tmp/debtap
exit 1
@ -3404,7 +3409,6 @@ fi
# Removing leftover files
echo -e "${lightgreen}==>${NC} ${bold}Removing leftover files...${normal}"
cd ..
rm -rf "$working_directory"
rm -rf /tmp/debtap
exit 0