LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 819|回复: 1

foxit reader for linux 1.0 SlackBuild 脚本

[复制链接]
发表于 2009-4-22 21:53:45 | 显示全部楼层 |阅读模式
foxit reader for Linux 终于出了1.0正式版。
在slackware下写了简单的脚本方便大家用。
到官方网站上下载 rpm包。

脚本如下 foxit-reader.SlackBuild

  1. #!/bin/sh

  2. # Slackware build script for foxit-reader for linux

  3. PRGNAM=foxit-reader       
  4. VERSION=${VERSION:-1.0}
  5. ARCH=${ARCH:-i386}
  6. BUILD=${BUILD:-1}
  7. TAG=${TAG:-_SBo}

  8. CWD=$(pwd)
  9. TMP=${TMP:-/tmp/SBo}
  10. PKG=$TMP/package-$PRGNAM
  11. OUTPUT=${OUTPUT:-/tmp}

  12. set -e

  13. rm -rf $PKG
  14. mkdir -p $TMP $PKG $OUTPUT
  15. cd $PKG
  16. rpm2targz $CWD/FoxitReader-$VERSION-1.$ARCH.rpm
  17. tar xvzf *.tar.gz
  18. rm *.tar.gz

  19. # rename the desktop file name
  20. cd usr/share/applications
  21. mv fedora-Foxit-Reader.desktop foxit-reader.desktop

  22. # fix the perm right
  23. cd $PKG
  24. chown -R root:root .
  25. find . \
  26. \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
  27. -exec chmod 755 {} \; -o \
  28. \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
  29. -exec chmod 644 {} \;

  30. # add the link
  31. ( cd $PKG/usr/bin
  32.   ln -s FoxitReader foxitreader
  33. )

  34. # rip the file
  35. ( cd $PKG
  36.   find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  37.   find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
  38. )

  39. mkdir -p $PKG/install
  40. cat $CWD/slack-desc > $PKG/install/slack-desc

  41. cd $PKG
  42. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.tgz
复制代码


slack-desc 文件

  1. # HOW TO EDIT THIS FILE:
  2. # The "handy ruler" below makes it easier to edit a package description.  Line
  3. # up the first '|' above the ':' following the base package name, and the '|'
  4. # on the right side marks the last column you can put a character in.  You must
  5. # make exactly 11 lines for the formatting to be correct.  It's also
  6. # customary to leave one space after the ':'.

  7.             |-----handy-ruler-----------------------------------------|
  8. foxit-reader: Foxit Reader for Desktop Linux
  9. foxit-reader:
  10. foxit-reader: Foxit Reader is a free PDF document viewer for the
  11. foxit-reader: Linux platform, with a new streamlined interface,
  12. foxit-reader: user-customized toolbar, incredibly small size,
  13. foxit-reader: breezing-fast launch speed and rich features.
  14. foxit-reader:                  
  15. foxit-reader: Foxit Reader for Desktop Linux is provided by Foxit
  16. foxit-reader: Software Company free for non-commercial use.
  17. foxit-reader:
  18. foxit-reader: home: http://www.foxitsoftware.com/

复制代码
发表于 2009-4-23 12:23:31 | 显示全部楼层
slackbuilds.org is a good place to go ;)
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表