mirror of
https://gitdl.cn/https://github.com/chakralinux/core.git
synced 2025-02-06 09:57:15 +08:00
cinstall update
This commit is contained in:
parent
d6a828d60b
commit
9426cb9d16
@ -1,42 +0,0 @@
|
||||
#
|
||||
# Chakra Packages for Chakra, part of chakra-project.org
|
||||
#
|
||||
# maintainer abveritas@chakra-project.org
|
||||
# (c) 2010 Drake Justice
|
||||
|
||||
pkgname=cinstall
|
||||
pkgver=0.4.7.2
|
||||
pkgrel=1
|
||||
depends=('rsync' 'cbundle' 'kdelibs' 'qjson')
|
||||
makedepends=('qt' 'automoc4' 'libcroco')
|
||||
pkgdesc="Chakra's Bundle manager"
|
||||
arch=("i686" "x86_64")
|
||||
license=('GPL')
|
||||
install=$pkgname.install
|
||||
url="http://chakra-project.org/"
|
||||
|
||||
source=("http://chakra-linux.org/sources/cinstall/cinstall-$pkgver.tar.xz")
|
||||
md5sums=('8b07797dd208972d57d058dce53a5137')
|
||||
|
||||
# create tarball: source PKGBUILD && mksource
|
||||
|
||||
mksource() {
|
||||
git clone git://gitorious.org//chakra/cinstall.git
|
||||
pushd cinstall
|
||||
popd
|
||||
tar -cvJf cinstall-${pkgver}.tar.xz cinstall/*
|
||||
md5sum cinstall-${pkgver}.tar.xz
|
||||
}
|
||||
|
||||
build() {
|
||||
cd "${srcdir}/cinstall"
|
||||
|
||||
cmake \
|
||||
-DCMAKE_INSTALL_PREFIX=/usr \
|
||||
-DCMAKE_BUILD_TYPE=Release
|
||||
make
|
||||
}
|
||||
package() {
|
||||
cd "${srcdir}/cinstall"
|
||||
make DESTDIR=${pkgdir} install
|
||||
}
|
@ -1,145 +0,0 @@
|
||||
post_install() {
|
||||
if [ -e "/etc/chakra/updates.conf" ] ; then
|
||||
|
||||
. /etc/chakra/updates.conf
|
||||
|
||||
if [ "$UPDATE_XDG_ICON_DB" = "yes" ]; then
|
||||
/usr/bin/chakra-update-icons
|
||||
fi
|
||||
|
||||
else
|
||||
echo " > WARNING"
|
||||
echo " The package kde-common seems not to be installed,"
|
||||
echo " this can possibly break the installation. Just install it"
|
||||
echo " manually after this installation/update, run the following"
|
||||
echo " commands and restart KDE afterwards:"
|
||||
echo " sudo chakra-config-updater"
|
||||
echo " kbuildsycoca4"
|
||||
echo " "
|
||||
fi
|
||||
|
||||
echo "Create group bundle"
|
||||
|
||||
if [ "Group: `grep bundle /etc/group`" = "Group: " ] ; then
|
||||
groupadd bundle
|
||||
else
|
||||
echo "Group bundle already exists"
|
||||
fi
|
||||
|
||||
echo "Adding all existing users to group bundle"
|
||||
|
||||
for i in `cat /etc/passwd | grep /home | cut -d: -f1` ; do
|
||||
echo " - adding user $i"
|
||||
usermod -a -G bundle $i
|
||||
done
|
||||
|
||||
echo "Configuring sudoers file"
|
||||
if [ "`grep '/bin/mount -o loop -t squashfs' /etc/sudoers`" = "" ] ; then
|
||||
echo "%bundle ALL=NOPASSWD: /bin/mount -o loop -t squashfs *" >> /etc/sudoers
|
||||
elif [ "`grep '/bin/mount -o loop -t ext4' /etc/sudoers`" = "" ] ; then
|
||||
echo "%bundle ALL=NOPASSWD: /bin/mount -o loop -t ext4 *" >> /etc/sudoers
|
||||
elif [ "`grep '/bin/umount *' /etc/sudoers`" = "" ] ; then
|
||||
echo "%bundle ALL=NOPASSWD: /bin/umount *" >> /etc/sudoers
|
||||
elif [ "`grep '/bin/chmod a+w *' /etc/sudoers`" = "" ] ; then
|
||||
echo "%bundle ALL=NOPASSWD: /bin/chmod a+w *" >> /etc/sudoers
|
||||
else
|
||||
echo "sudoers file already modded"
|
||||
fi
|
||||
|
||||
chmod -v 0440 /etc/sudoers &>/dev/null
|
||||
|
||||
mkdir -p /etc/cb.conf.d &>/dev/null
|
||||
chmod 775 /etc/cb.conf.d &>/dev/null
|
||||
chown -R root:bundle /etc/cb.conf.d &>/dev/null
|
||||
|
||||
echo "update mime-database"
|
||||
update-mime-database /usr/share/mime &>/dev/null
|
||||
}
|
||||
|
||||
post_upgrade() {
|
||||
if [ -e "/etc/chakra/updates.conf" ] ; then
|
||||
|
||||
. /etc/chakra/updates.conf
|
||||
|
||||
if [ "$UPDATE_XDG_ICON_DB" = "yes" ]; then
|
||||
/usr/bin/chakra-update-icons
|
||||
fi
|
||||
|
||||
else
|
||||
echo " > WARNING"
|
||||
echo " The package kde-common seems not to be installed,"
|
||||
echo " this can possibly break the installation. Just install it"
|
||||
echo " manually after this installation/update, run the following"
|
||||
echo " commands and restart KDE afterwards:"
|
||||
echo " sudo chakra-config-updater"
|
||||
echo " kbuildsycoca4"
|
||||
echo " "
|
||||
fi
|
||||
|
||||
echo "Create group bundle"
|
||||
|
||||
if [ "Group: `grep bundle /etc/group`" = "Group: " ] ; then
|
||||
groupadd bundle
|
||||
else
|
||||
echo "Group bundle already exists"
|
||||
fi
|
||||
|
||||
echo "Adding all existing users to group bundle"
|
||||
|
||||
for i in `cat /etc/passwd | grep /home | cut -d: -f1` ; do
|
||||
echo " - adding user $i"
|
||||
usermod -a -G bundle $i
|
||||
done
|
||||
|
||||
echo "Configuring sudoers file"
|
||||
if [ "`grep '/bin/mount -o loop -t squashfs' /etc/sudoers`" = "" ] ; then
|
||||
echo "%bundle ALL=NOPASSWD: /bin/mount -o loop -t squashfs *" >> /etc/sudoers
|
||||
elif [ "`grep '/bin/mount -o loop -t ext4' /etc/sudoers`" = "" ] ; then
|
||||
echo "%bundle ALL=NOPASSWD: /bin/mount -o loop -t ext4 *" >> /etc/sudoers
|
||||
elif [ "`grep '/bin/umount *' /etc/sudoers`" = "" ] ; then
|
||||
echo "%bundle ALL=NOPASSWD: /bin/umount *" >> /etc/sudoers
|
||||
elif [ "`grep '/bin/chmod a+w *' /etc/sudoers`" = "" ] ; then
|
||||
echo "%bundle ALL=NOPASSWD: /bin/chmod a+w *" >> /etc/sudoers
|
||||
else
|
||||
echo "sudoers file already modded"
|
||||
fi
|
||||
|
||||
chmod -v 0440 /etc/sudoers &>/dev/null
|
||||
|
||||
mkdir -p /etc/cb.conf.d &>/dev/null
|
||||
chmod 775 /etc/cb.conf.d &>/dev/null
|
||||
chown -R root:bundle /etc/cb.conf.d &>/dev/null
|
||||
rm /etc/cb.conf.d/* -r &>/dev/null
|
||||
|
||||
echo "update mime-database"
|
||||
update-mime-database /usr/share/mime &>/dev/null
|
||||
}
|
||||
|
||||
post_remove() {
|
||||
if [ -e "/etc/chakra/updates.conf" ] ; then
|
||||
|
||||
. /etc/chakra/updates.conf
|
||||
|
||||
if [ "$UPDATE_XDG_ICON_DB" = "yes" ]; then
|
||||
/usr/bin/chakra-update-icons
|
||||
fi
|
||||
|
||||
else
|
||||
echo " > WARNING"
|
||||
echo " The package kde-common seems not to be installed,"
|
||||
echo " this can possibly break the installation. Just install it"
|
||||
echo " manually after this installation/update, run the following"
|
||||
echo " commands and restart KDE afterwards:"
|
||||
echo " sudo chakra-config-updater"
|
||||
echo " kbuildsycoca4"
|
||||
echo " "
|
||||
fi
|
||||
|
||||
rm /etc/cb.conf.d -r &>/dev/null
|
||||
|
||||
}
|
||||
|
||||
op=$1
|
||||
shift
|
||||
|
||||
$op $*
|
Loading…
Reference in New Issue
Block a user