Commit 5a94f193 authored by Marcus Nordenberg's avatar Marcus Nordenberg Committed by Esteban Blanc

pkg: fix pwr package for debian x86_64

(cherry picked from commit fe3f8ad1fc0e1e666015a3a3732bd18ca9248afd)
parent 7ed723fb
...@@ -47,7 +47,7 @@ fi ...@@ -47,7 +47,7 @@ fi
echo "<b>Proview V${version:0:3}" echo "<b>Proview V${version:0:3}"
echo "Version V$version" echo "Version V$version"
echo "" echo ""
echo "Copyright 2005-${d:0:4} SSAB EMEA AB" echo "Copyright 2005-${d:0:4} SSAB EMEA AB"
echo "" echo ""
echo "This program is free software; you can redistribute it and/or" echo "This program is free software; you can redistribute it and/or"
echo "modify it under the terms of the GNU General Public License as" echo "modify it under the terms of the GNU General Public License as"
...@@ -103,7 +103,7 @@ echo "-- Building pwr$ver" ...@@ -103,7 +103,7 @@ echo "-- Building pwr$ver"
mkdir -p $pkgroot/DEBIAN mkdir -p $pkgroot/DEBIAN
mkdir -p $pkgroot/usr/share/doc/pwr$ver mkdir -p $pkgroot/usr/share/doc/pwr$ver
mkdir -p $pkgroot/usr/share/applications mkdir -p $pkgroot/usr/share/applications
mkdir -p $pkgroot/usr/pwrp mkdir -p $pkgroot/usr/pwrp/adm/db
mkdir -p $pkgroot/etc mkdir -p $pkgroot/etc
find $pkgroot -type d | xargs chmod 755 find $pkgroot -type d | xargs chmod 755
...@@ -115,8 +115,10 @@ echo "ver=\"$ver\"" >> $pkgroot/DEBIAN/postinst ...@@ -115,8 +115,10 @@ echo "ver=\"$ver\"" >> $pkgroot/DEBIAN/postinst
echo "pwre_target=\"$pwre_target\"" >> $pkgroot/DEBIAN/postinst echo "pwre_target=\"$pwre_target\"" >> $pkgroot/DEBIAN/postinst
cat $pkgsrc/postinst >> $pkgroot/DEBIAN/postinst cat $pkgsrc/postinst >> $pkgroot/DEBIAN/postinst
cp $pkgsrc/prerm $pkgroot/DEBIAN cp $pkgsrc/prerm $pkgroot/DEBIAN
cp $pkgsrc/postrm $pkgroot/DEBIAN
chmod 755 $pkgroot/DEBIAN/postinst chmod 755 $pkgroot/DEBIAN/postinst
chmod 755 $pkgroot/DEBIAN/prerm chmod 755 $pkgroot/DEBIAN/prerm
chmod 755 $pkgroot/DEBIAN/postrm
chmod 644 $pkgroot/DEBIAN/control chmod 644 $pkgroot/DEBIAN/control
# copyright # copyright
...@@ -172,13 +174,8 @@ cp $pwre_sroot/tools/pkg/$hw/adm/proview_icon.png $pkgroot/usr/pwr$ver/$pwre_tar ...@@ -172,13 +174,8 @@ cp $pwre_sroot/tools/pkg/$hw/adm/proview_icon.png $pkgroot/usr/pwr$ver/$pwre_tar
# Copy user to cnf # Copy user to cnf
mkdir $pkgroot/usr/pwr$ver/$pwre_target/exp/cnf/user mkdir $pkgroot/usr/pwr$ver/$pwre_target/exp/cnf/user
cp $pwre_sroot/tools/pkg/$hw/user/.bashrc $pkgroot/usr/pwr$ver/$pwre_target/exp/cnf/user
echo "source $aroot/db/pwr_setup.sh" >> $pkgroot/usr/pwr$ver/$pwre_target/exp/cnf/user/.bashrc
cp $pwre_sroot/tools/pkg/$hw/user/.bash_profile $pkgroot/usr/pwr$ver/$pwre_target/exp/cnf/user
#cp $pwre_sroot/tools/pkg/$hw/user/.mwmrc $pkgroot/usr/pwr$ver/$pwre_target/exp/cnf/user
cp $pwre_sroot/tools/pkg/$hw/user/.rtt_start $pkgroot/usr/pwr$ver/$pwre_target/exp/cnf/user cp $pwre_sroot/tools/pkg/$hw/user/.rtt_start $pkgroot/usr/pwr$ver/$pwre_target/exp/cnf/user
cp $pwre_sroot/tools/pkg/$hw/user/.xtt_start $pkgroot/usr/pwr$ver/$pwre_target/exp/cnf/user cp $pwre_sroot/tools/pkg/$hw/user/.xtt_start $pkgroot/usr/pwr$ver/$pwre_target/exp/cnf/user
#cp $pwre_sroot/tools/pkg/$hw/user/.xsession $pkgroot/usr/pwr$ver/$pwre_target/exp/cnf/user
cp $pwre_sroot/tools/pkg/$hw/user/wtt_init.pwr_com $pkgroot/usr/pwr$ver/$pwre_target/exp/cnf/user cp $pwre_sroot/tools/pkg/$hw/user/wtt_init.pwr_com $pkgroot/usr/pwr$ver/$pwre_target/exp/cnf/user
cp $pwre_sroot/tools/pkg/$hw/user/wtt_init1.pwr_com $pkgroot/usr/pwr$ver/$pwre_target/exp/cnf/user cp $pwre_sroot/tools/pkg/$hw/user/wtt_init1.pwr_com $pkgroot/usr/pwr$ver/$pwre_target/exp/cnf/user
......
...@@ -3,22 +3,7 @@ Version: 5.7.2-1 ...@@ -3,22 +3,7 @@ Version: 5.7.2-1
Section: base Section: base
Priority: optional Priority: optional
Architecture: amd64 Architecture: amd64
Depends: libc6 (>= 2.28-10), Depends: libc6 (>= 2.24-11), libgtk2.0-0 (>= 2.24.31-2), libasound2 (>= 1.1.3-5), libdb5.3 (>=5.3.28-12), libdb5.3++ (>= 5.3.28-12), libsqlite3-0 (>= 3.16.2-5), librsvg2-2 (>= 2.40.16-1), g++ (>= 4:6.3.0-4), xterm, libmariadb3 (>=1:10.3.22-0), librabbitmq4 (>= 0.8.0-1), libhdf5-openmpi-103 (>= 1.10.4), libusb-1.0-0 (>= 2:1.0.22-2)
libgtk2.0-0 (>= 2.24.24-3),
libasound2 (>= 1.1.8-1),
libdb5.3 (>=5.3.28-12),
libdb5.3++ (>= 5.3.28),
libsqlite3-0 (>= 3.23.2-3),
librsvg2-2 (>= 2.44.10-2.1),
g++ (>= 4:8.3.0-1),
libmariadb3 (>=1:10.3.17-0+deb10u1),
librabbitmq4 (>= 0.9.0-0.2),
libusb-1.0-0 (>=2:1.0.22-2),
libhdf5-openmpi-103 (>=1.10.4),
libgstreamer1.0-0 (>=1.14.4-1),
libgstreamer-plugins-base1.0-0 (>=1.14.4-2),
xterm,
xfonts-100dpi
Replaces: pwrrt,pwr34,pwr39,pwr40,pwr41,pwr42,pwr43,pwr44,pwr45,pwr46,pwr47,pwr48,pwr50,pwr51,pwr52,pwr53,pwr54,pwr55,pwr56 Replaces: pwrrt,pwr34,pwr39,pwr40,pwr41,pwr42,pwr43,pwr44,pwr45,pwr46,pwr47,pwr48,pwr50,pwr51,pwr52,pwr53,pwr54,pwr55,pwr56
Maintainer: ProviewR <postmaster@proview.se> Maintainer: ProviewR <postmaster@proview.se>
Description: ProviewR development and runtime environment package Description: ProviewR development and runtime environment package
......
#!/bin/sh
set -e
# ver="" # Exec string (Shell) is inserted by build-script...
# pwre_target="" set -e
echo "Here in postinst..."
# Automatically added by dh_installdocs # Automatically added by dh_installdocs
if [ "$1" = "configure" ]; then if [ "$1" = "configure" ]; then
if [ -d /usr/doc -a ! -e /usr/doc/pwrtest -a -d /usr/share/doc/pwrtest ]; then if [ -d /usr/doc -a ! -e /usr/doc/pwrtest -a -d /usr/share/doc/pwrtest ]; then
...@@ -16,38 +13,31 @@ fi ...@@ -16,38 +13,31 @@ fi
aroot="/usr/pwrp/adm" aroot="/usr/pwrp/adm"
if getent group pwrp > /dev/null; then if getent group pwrp > /dev/null; then
echo "-- group pwrp already exist" echo "-- Group pwrp already exist. OK!"
else else
if groupadd pwrp; then if groupadd pwrp; then
echo "-- group pwrp added" echo "-- Group pwrp added"
fi fi
fi fi
if getent passwd pwrp > /dev/null; then if getent passwd pwrp > /dev/null; then
echo "-- user pwrp already exist" echo "-- User pwrp already exist. OK!"
else else
new_user=1 new_user=1
if useradd -s /bin/bash -p aaupl/kQs1p3U -g pwrp -d /home/pwrp pwrp; then if useradd --create-home --shell /bin/bash --password aaupl/kQs1p3U --gid pwrp --home-dir /home/pwrp pwrp; then
echo "-- user pwrp added" echo "-- User pwrp added"
fi fi
if [ ! -e /home/pwrp ]; then
mkdir /home/pwrp cp /usr/pwr$ver/$pwre_target/exp/cnf/user/.rtt_start /home/pwrp && chmod a+x /home/pwrp/.rtt_start
fi cp /usr/pwr$ver/$pwre_target/exp/cnf/user/.xtt_start /home/pwrp && chmod a+x /home/pwrp/.xtt_start
cp /usr/pwr$ver/$pwre_target/exp/cnf/user/.bashrc /home/pwrp
cp /usr/pwr$ver/$pwre_target/exp/cnf/user/.bash_profile /home/pwrp
# cp /usr/pwr$ver/$pwre_target/exp/cnf/user/.mwmrc /home/pwrp
cp /usr/pwr$ver/$pwre_target/exp/cnf/user/.rtt_start /home/pwrp
chmod a+x /home/pwrp/.rtt_start
cp /usr/pwr$ver/$pwre_target/exp/cnf/user/.xtt_start /home/pwrp
chmod a+x /home/pwrp/.xtt_start
# cp /usr/pwr$ver/$pwre_target/exp/cnf/user/.xsession /home/pwrp
cp /usr/pwr$ver/$pwre_target/exp/cnf/user/wtt_init.pwr_com /home/pwrp cp /usr/pwr$ver/$pwre_target/exp/cnf/user/wtt_init.pwr_com /home/pwrp
cp /usr/pwr$ver/$pwre_target/exp/cnf/user/wtt_init1.pwr_com /home/pwrp cp /usr/pwr$ver/$pwre_target/exp/cnf/user/wtt_init1.pwr_com /home/pwrp
chown -R pwrp /home/pwrp chown -R pwrp:pwrp /home/pwrp
chgrp -R pwrp /home/pwrp
fi fi
# A bit intrusive for those who have chosen not to use these folders...
if [ ! -e /home/pwrp/Desktop ]; then if [ ! -e /home/pwrp/Desktop ]; then
mkdir /home/pwrp/Desktop mkdir /home/pwrp/Desktop
fi fi
...@@ -55,7 +45,7 @@ cp /usr/pwr$ver/$pwre_target/exp/cnf/user/proview$ver.desktop /home/pwrp/Desktop ...@@ -55,7 +45,7 @@ cp /usr/pwr$ver/$pwre_target/exp/cnf/user/proview$ver.desktop /home/pwrp/Desktop
chown pwrp:pwrp /home/pwrp/Desktop/proview$ver.desktop chown pwrp:pwrp /home/pwrp/Desktop/proview$ver.desktop
chmod a+x /home/pwrp/Desktop/proview$ver.desktop chmod a+x /home/pwrp/Desktop/proview$ver.desktop
echo "Change owner of files to pwrp" echo "-- Change owner of files to pwrp"
chown -R pwrp /usr/pwr$ver chown -R pwrp /usr/pwr$ver
chgrp -R pwrp /usr/pwr$ver chgrp -R pwrp /usr/pwr$ver
...@@ -77,7 +67,8 @@ if ! grep -q "/etc/pwrp_profile\b" /etc/profile; then ...@@ -77,7 +67,8 @@ if ! grep -q "/etc/pwrp_profile\b" /etc/profile; then
if [ -e /etc/pwrp_profile ]; then if [ -e /etc/pwrp_profile ]; then
source /etc/pwrp_profile source /etc/pwrp_profile
fi fi
EOF EOF
:
fi fi
# Create and copy adm # Create and copy adm
...@@ -95,6 +86,11 @@ if [ ! -e $aroot/db/pwr_user2.dat ]; then ...@@ -95,6 +86,11 @@ if [ ! -e $aroot/db/pwr_user2.dat ]; then
cp /usr/pwr$ver/$pwre_target/exp/cnf/pwr_user2.dat $aroot/db cp /usr/pwr$ver/$pwre_target/exp/cnf/pwr_user2.dat $aroot/db
fi fi
# Source pwr_setup.sh in pwrp's .bashrc
if ! grep ". ${aroot}/db/pwr_setup.sh" /home/pwrp/.bashrc >/dev/null 2>&1; then
echo ". ${aroot}/db/pwr_setup.sh" >> /home/pwrp/.bashrc
fi
# Insert base in projectlist # Insert base in projectlist
if [ ! -e $aroot/db/pwr_projectlist.dat ]; then if [ ! -e $aroot/db/pwr_projectlist.dat ]; then
echo "%base V${ver:0:1}.${ver:1:1} /usr/pwr$ver" > $aroot/db/pwr_projectlist.dat echo "%base V${ver:0:1}.${ver:1:1} /usr/pwr$ver" > $aroot/db/pwr_projectlist.dat
......
#!/bin/sh
set -e
# Remove proview.cnf if we are purging
if [ "$1" = "purge" -a -e /etc/proview.cnf ]; then
rm /etc/proview.cnf
echo "-- Purged /etc/proview.cnf"
fi
# Do not source pwr_setup.sh anymore if we have removed/purged pwr
if [ \( "$1" = "remove" -o "$1" = "purge" \) -a -e /home/pwrp/.bashrc ]; then
sed -i '/\. \/usr\/pwrp\/adm\/db\/pwr_setup.sh/d' /home/pwrp/.bashrc
echo "-- Restored .bashrc for user pwrp"
fi
# Remove everything if we are purging...
if [ "$1" = "purge" ]; then
echo "-- Removing projects, users, and configuration..."
echo -n "Do you want to remove all projects (in /usr/local/pwrp)? (y/n) [n] "
read remove_projects
if [ "$remove_projects" = "y" ]; then
rm -rf /usr/local/pwrp
rm -rf /usr/pwrp
echo "-- Removed projects and their metadata"
fi
echo -n "Do you want to remove the user and group pwrp? (y/n) [n] "
read remove_user
if [ "$remove_user" = "y" ]; then
getent passwd pwrp >/dev/null 2>&1 && userdel -rf pwrp 2>/dev/null
echo "-- Removed user pwrp"
getent group pwrp >/dev/null 2>&1 && groupdel pwrp
echo "-- Removed group pwrp"
fi
fi
#!/bin/sh #!/bin/sh
set -e set -e
echo "Here in prerm..."
# Automatically added by dh_installdocs # Automatically added by dh_installdocs
if [ \( "$1" = "upgrade" -o "$1" = "remove" \) -a -L /usr/doc/pwrtest ]; then if [ \( "$1" = "upgrade" -o "$1" = "remove" \) -a -L /usr/doc/pwrtest ]; then
rm -f /usr/doc/pwrtest rm -f /usr/doc/pwrtest
......
bus_id="" bus_id=""
if [ -e /etc/proview.cnf ]; then if [ -e /etc/proview.cnf ]; then
bus_id=`eval cat /etc/proview.cnf | grep "\\bqcomBusId\\b" | awk '{print $2}'` bus_id=`eval cat /etc/proview.cnf | grep "\\bqcomBusId\\b" | awk '{print $2}'`
...@@ -9,26 +8,28 @@ fi ...@@ -9,26 +8,28 @@ fi
export PWR_BUS_ID=$bus_id export PWR_BUS_ID=$bus_id
export pwrb_root=/usr/pwrrt # Setup $pwrp_XXXX variables if we have /pwrp. We expect to only find one type of arch on a runtime system. First one found is used...
export pwrp_root=/pwrp if [ -e /pwrp ]; then
export pwrp_root=/pwrp
for dir in `ls -1 /pwrp`; do
[[ "${dir}" == "common" ]] && continue
arch=${dir}
break
done
# Set arch specific env variables
for env in exe obj lis lib; do
export pwrp_${env}=${pwrp_root}/${arch}/${env}
done
export pwr_exe=$pwrb_root/exe # Set common env variables
export pwr_lib=$pwrb_root/lib export pwrp_inc=$pwrp_root/common/inc
export pwr_obj=$pwrb_root/obj export pwrp_load=$pwrp_root/common/load
export pwr_inc=$pwrb_root/inc export pwrp_log=$pwrp_root/common/log
export pwr_load=$pwrb_root/load export pwrp_db=$pwrp_root/common/db
export pwr_lis=$pwrb_root/lis
export pwr_doc=$pwrb_root/doc
export pwrp_exe=$pwrp_root/x86_linux/exe export pwrp_web=$web_dir
export pwrp_lib=$pwrp_root/x86_linux/lib fi
export pwrp_obj=$pwrp_root/x86_linux/obj
export pwrp_lis=$pwrp_root/x86_linux/lis
export pwrp_inc=$pwrp_root/common/inc
export pwrp_load=$pwrp_root/common/load
export pwrp_log=$pwrp_root/common/log
export pwrp_db=$pwrp_root/common/db
export pwrp_web=$web_dir
export pwra_db=/usr/pwrp/adm/db export pwra_db=/usr/pwrp/adm/db
...@@ -44,7 +45,7 @@ fi ...@@ -44,7 +45,7 @@ fi
if [ -z "$jdk" ]; then if [ -z "$jdk" ]; then
if [ -e /usr/lib/jvm/default-java ]; then if [ -e /usr/lib/jvm/default-java ]; then
jdk=`eval realpath -qe /usr/lib/jvm/default-java` jdk=`eval realpath -qe /usr/lib/jvm/default-java`
else elif [ -e /usr/lib/jvm ]; then
jdk_name=`eval ls -1 /usr/lib/jvm | sort -r | grep ^java | head -1` jdk_name=`eval ls -1 /usr/lib/jvm | sort -r | grep ^java | head -1`
jdk=`eval realpath -qe /usr/lib/jvm/$jdk_name` jdk=`eval realpath -qe /usr/lib/jvm/$jdk_name`
unset jdk_name unset jdk_name
...@@ -63,12 +64,11 @@ fi ...@@ -63,12 +64,11 @@ fi
PATH=$PATH:$pwr_exe:$pwrp_exe:$jdk_home PATH=$PATH:$pwr_exe:$pwrp_exe:$jdk_home
#symbols to define start/stop commands for PWR # Symbols to define start/stop commands for PWR
alias pwr_stop='/etc/init.d/pwr stop' alias pwr_stop='/etc/init.d/pwr stop'
alias pwr_stop.sh="/etc/init.d/pwr stop" alias pwr_stop.sh="/etc/init.d/pwr stop"
alias pwr_start="/etc/init.d/pwr start" alias pwr_start="/etc/init.d/pwr start"
alias pwr="/etc/init.d/pwr" alias pwr="/etc/init.d/pwr"
alias boot="/usr/bin/sudo /sbin/reboot"
if [ -e $pwrp_exe/profile ]; then if [ -e $pwrp_exe/profile ]; then
source $pwrp_exe/profile source $pwrp_exe/profile
......
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