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
echo "<b>Proview V${version:0:3}"
echo "Version V$version"
echo ""
echo "Copyright 2005-${d:0:4} SSAB EMEA AB"
echo "Copyright 2005-${d:0:4} SSAB EMEA AB"
echo ""
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"
......@@ -103,7 +103,7 @@ echo "-- Building pwr$ver"
mkdir -p $pkgroot/DEBIAN
mkdir -p $pkgroot/usr/share/doc/pwr$ver
mkdir -p $pkgroot/usr/share/applications
mkdir -p $pkgroot/usr/pwrp
mkdir -p $pkgroot/usr/pwrp/adm/db
mkdir -p $pkgroot/etc
find $pkgroot -type d | xargs chmod 755
......@@ -115,8 +115,10 @@ echo "ver=\"$ver\"" >> $pkgroot/DEBIAN/postinst
echo "pwre_target=\"$pwre_target\"" >> $pkgroot/DEBIAN/postinst
cat $pkgsrc/postinst >> $pkgroot/DEBIAN/postinst
cp $pkgsrc/prerm $pkgroot/DEBIAN
cp $pkgsrc/postrm $pkgroot/DEBIAN
chmod 755 $pkgroot/DEBIAN/postinst
chmod 755 $pkgroot/DEBIAN/prerm
chmod 755 $pkgroot/DEBIAN/postrm
chmod 644 $pkgroot/DEBIAN/control
# copyright
......@@ -172,13 +174,8 @@ cp $pwre_sroot/tools/pkg/$hw/adm/proview_icon.png $pkgroot/usr/pwr$ver/$pwre_tar
# Copy user to cnf
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/.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_init1.pwr_com $pkgroot/usr/pwr$ver/$pwre_target/exp/cnf/user
......
......@@ -3,22 +3,7 @@ Version: 5.7.2-1
Section: base
Priority: optional
Architecture: amd64
Depends: libc6 (>= 2.28-10),
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
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)
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>
Description: ProviewR development and runtime environment package
......
#!/bin/sh
set -e
# ver=""
# pwre_target=""
# Exec string (Shell) is inserted by build-script...
set -e
echo "Here in postinst..."
# Automatically added by dh_installdocs
if [ "$1" = "configure" ]; then
if [ -d /usr/doc -a ! -e /usr/doc/pwrtest -a -d /usr/share/doc/pwrtest ]; then
......@@ -16,38 +13,31 @@ fi
aroot="/usr/pwrp/adm"
if getent group pwrp > /dev/null; then
echo "-- group pwrp already exist"
echo "-- Group pwrp already exist. OK!"
else
if groupadd pwrp; then
echo "-- group pwrp added"
echo "-- Group pwrp added"
fi
fi
if getent passwd pwrp > /dev/null; then
echo "-- user pwrp already exist"
echo "-- User pwrp already exist. OK!"
else
new_user=1
if useradd -s /bin/bash -p aaupl/kQs1p3U -g pwrp -d /home/pwrp pwrp; then
echo "-- user pwrp added"
if useradd --create-home --shell /bin/bash --password aaupl/kQs1p3U --gid pwrp --home-dir /home/pwrp pwrp; then
echo "-- User pwrp added"
fi
if [ ! -e /home/pwrp ]; then
mkdir /home/pwrp
fi
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/.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/wtt_init.pwr_com /home/pwrp
cp /usr/pwr$ver/$pwre_target/exp/cnf/user/wtt_init1.pwr_com /home/pwrp
chown -R pwrp /home/pwrp
chgrp -R pwrp /home/pwrp
chown -R pwrp:pwrp /home/pwrp
fi
# A bit intrusive for those who have chosen not to use these folders...
if [ ! -e /home/pwrp/Desktop ]; then
mkdir /home/pwrp/Desktop
fi
......@@ -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
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
chgrp -R pwrp /usr/pwr$ver
......@@ -73,11 +63,12 @@ fi
# Add pwrp_profile to profile
if ! grep -q "/etc/pwrp_profile\b" /etc/profile; then
cat >> /etc/profile <<-EOF
if [ -e /etc/pwrp_profile ]; then
source /etc/pwrp_profile
fi
EOF
cat >> /etc/profile <<-EOF
if [ -e /etc/pwrp_profile ]; then
source /etc/pwrp_profile
fi
EOF
:
fi
# Create and copy adm
......@@ -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
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
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
......
#!/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
set -e
echo "Here in prerm..."
# Automatically added by dh_installdocs
if [ \( "$1" = "upgrade" -o "$1" = "remove" \) -a -L /usr/doc/pwrtest ]; then
rm -f /usr/doc/pwrtest
......
bus_id=""
if [ -e /etc/proview.cnf ]; then
bus_id=`eval cat /etc/proview.cnf | grep "\\bqcomBusId\\b" | awk '{print $2}'`
......@@ -9,26 +8,28 @@ fi
export PWR_BUS_ID=$bus_id
export pwrb_root=/usr/pwrrt
export pwrp_root=/pwrp
# 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...
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
export pwr_lib=$pwrb_root/lib
export pwr_obj=$pwrb_root/obj
export pwr_inc=$pwrb_root/inc
export pwr_load=$pwrb_root/load
export pwr_lis=$pwrb_root/lis
export pwr_doc=$pwrb_root/doc
# Set common env variables
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_exe=$pwrp_root/x86_linux/exe
export pwrp_lib=$pwrp_root/x86_linux/lib
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 pwrp_web=$web_dir
fi
export pwra_db=/usr/pwrp/adm/db
......@@ -44,7 +45,7 @@ fi
if [ -z "$jdk" ]; then
if [ -e /usr/lib/jvm/default-java ]; then
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=`eval realpath -qe /usr/lib/jvm/$jdk_name`
unset jdk_name
......@@ -63,12 +64,11 @@ fi
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.sh="/etc/init.d/pwr stop"
alias pwr_start="/etc/init.d/pwr start"
alias pwr="/etc/init.d/pwr"
alias boot="/usr/bin/sudo /sbin/reboot"
if [ -e $pwrp_exe/profile ]; then
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