trinity-devel@lists.pearsoncomputing.net

Message: previous - next
Month: May 2011

Arch - kdebase packaging - install versus cp + chmod?

From: "David C. Rankin" <drankinatty@...>
Date: Mon, 02 May 2011 21:43:54 -0500
Baho - and others interested in packaging specifics,

   In the kdebase PKGBUILD, I handled packaging of kdmrc and the Xsession file 
as follows:

   # set kdm directory
   _kdmdir=${trinity_prefix}/share/config/kdm
   [[ -d ${pkgdir}/${_kdmdir} ]] || install -d -m755 ${pkgdir}/${_kdmdir}

   # install kdmrc
   [[ -f kdmrc ]] && install -m644 kdmrc ${pkgdir}/${_kdmdir}

   # update the Xsession file
   [[ -f Xsession ]] && install -m755 Xsession ${pkgdir}/${_kdmdir}

   # create the starttrinity link
   [[ -d ${pkgdir}/usr/bin ]] || mkdir -p ${pkgdir}/usr/bin
   cd ${pkgdir}/usr/bin
   ln -sf /opt/trinity/bin/startkde starttrinity

You handled it slightly differently, primarily using cp and chmod instead of 
install and adding the 'n' option to the link of starttrinity:

     _kdmdir=${_prefix}/share/config/kdm
     [[ -d ${pkgdir}/${_kdmdir} ]] || install -d -m755 ${pkgdir}/${_kdmdir}
     [[ -f kdmrc ]] && cp -v kdmrc ${pkgdir}/${_kdmdir}
     [[ -f ${scrdir}/Xsession ]] && {
         cp -v ${scrdir}/Xsession ${pkgdir}/${_kdmdir}
         chmod 0755 ${pkgdir}/${_kdmdir}/Xsession
     }
     [[ -d ${pkgdir}/usr/bin ]] || mkdir -p ${pkgdir}/usr/bin
     ln -snf startkde ${pkgdir}/usr/bin/starttrinity

What is the benefit of using cp + chmod instead of 'install -m'? Also, why the 
'ln -snf' on starttrinity instead of just 'ln -sf'? Just habit or convention? On 
both, I'm just curious. If the cp + chmod is less problematic, then that's the 
way I want to go, but I don't want to just dismiss the use of install without 
understanding the benefit.

What says the master?

-- 
David C. Rankin, J.D.,P.E.