Advertisement
Weremouse

dirty_libfm-gtk-git.sh

Aug 12th, 2015
258
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 7.03 KB | None | 0 0
  1. #!/bin/dash
  2. # libfm-gtk-git.sh version 2015.08.12 Weremouse
  3.  
  4. # start
  5. if [ "$(id -u)" = "0" ]; then exit 1; fi
  6. printf "\033[7m"; date "+%a, %m %b %Y %T %z"
  7. printf "\nYou need to install all build dependencies first. \033[0m\n"
  8. libfm_release=1
  9. if [ ! "$1" = "" ]; then libfm_release=$1; fi
  10.  
  11. sudo rm -r libfm && echo "libfm removed" && echo && sleep 3
  12. sudo dpkg -P libfm-extra4 libmenu-cache3 libmenu-cache-dev libmenu-cache-bin libfm-gtk-git && echo "done" && echo
  13. sudo apt-get install libmenu-cache-dev && echo "done" && echo
  14.  
  15. # git pull
  16. if [ ! -d libfm ]; then
  17.   printf "\n\033[7mgit clone                                         \033[0m\n"
  18.   git clone https://github.com/lxde/libfm.git || exit 1
  19. fi
  20. printf "\n\033[7mgit pull --all                                    \033[0m\n"
  21. cd libfm
  22. git pull --all || exit 1
  23. libfm_version=$(git describe --always --abbrev=10 | sed "s/-/./g")
  24.  
  25. # configure and compile
  26. # the only difference to the Arch build is another prefix
  27. printf "\n\033[7mconfigure and build libfm                         \033[0m\n"
  28. if [ "$(ls libfm-gtk-git-$libfm_version-$libfm_release_*.deb)" = "" ]; then
  29.   printf "    this isn't an error\n\n"
  30.   ./autogen.sh
  31.   ./configure \
  32.   --with-gtk \
  33.   --enable-gtk-doc \
  34.   --disable-udisks \
  35.   --enable-actions \
  36.   --prefix="/usr/local" \
  37.   --sysconfdir="/etc"
  38.   make
  39. else
  40.   echo "The package $(ls libfm-gtk-git-$libfm_version-$libfm_release_*.deb) already exists."; exit 1
  41. fi
  42.  
  43. # build package and resolve issues
  44. printf "\n\033[7mbuild package and resolve issues                   \033[0m\n"
  45. printf "\n\033[7mYou need to install all runtime dependencies.      \nThe package doesn't include dependency information.\033[0m\n"
  46. #libfm_pkgs=libfm4,libfm-data,libfm-dev,libfm-doc,libfm-gtk4,libfm-gtk-data,libfm-gtk-dev,libfm-modules,libfm-tools,lxshortcut
  47. sudo checkinstall -y \
  48.   --install=no \
  49.   --pkgname=libfm-gtk-git \
  50.   --pkgversion=$libfm_version \
  51.   --pkgrelease=$libfm_release \
  52.   --pkglicense=GPL2 \
  53.   #--provides=$libfm_pkgs \
  54.   #--replaces=$libfm_pkgs \
  55.   #--conflicts=$libfm_pkgs \
  56.  
  57. # libmenu-cache is a build dependency, that forces to install libfm-extra4
  58. # libfm-extra.so.4 -> libfm-extra.so.4.0.3 is build from the upstream source
  59. # so building libfm requires itself as a build dependency
  60. # this is odd, we need to remove libfm-extra4 and install libmenu-cache3, libmenu-cache-dev and libmenu-cache-bin again
  61. # for some unknown reason a dummy packages are needed, so libfm_pkgs lines are commented out
  62. # if using libfm not only for lxpanel, other dummy packages might be needed too
  63.  
  64. sudo dpkg -P libfm-extra4 libmenu-cache3 libmenu-cache-dev libmenu-cache-bin
  65. # TODO replace with loop or function
  66. str=libfm-extra4
  67. echo "Section: misc"                                         > $str
  68. echo "Priority: optional"                                   >> $str
  69. echo "Standards-Version: 3.9.2"                             >> $str
  70. echo "Package: $str"                                        >> $str
  71. echo "Version: $libfm_version-$libfm_release"               >> $str
  72. echo "Provides: $str"                                       >> $str
  73. echo "Replaces: $str"                                       >> $str
  74. echo "Architecture: all"                                    >> $str
  75. echo "Description: This dummy packge fakes to provide $str" >> $str
  76.  
  77. equivs-build $str
  78. sudo dpkg -i "$str"_"$libfm_version-$libfm_release"_all.deb
  79.  
  80. str=libfm-data
  81. echo "Section: misc"                                         > $str
  82. echo "Priority: optional"                                   >> $str
  83. echo "Standards-Version: 3.9.2"                             >> $str
  84. echo "Package: $str"                                        >> $str
  85. echo "Version: $libfm_version-$libfm_release"               >> $str
  86. echo "Provides: $str"                                       >> $str
  87. echo "Replaces: $str"                                       >> $str
  88. echo "Architecture: all"                                    >> $str
  89. echo "Description: This dummy packge fakes to provide $str" >> $str
  90.  
  91. equivs-build $str
  92. sudo dpkg -i "$str"_"$libfm_version-$libfm_release"_all.deb
  93.  
  94. str=libfm-gtk-data
  95. echo "Section: misc"                                         > $str
  96. echo "Priority: optional"                                   >> $str
  97. echo "Standards-Version: 3.9.2"                             >> $str
  98. echo "Package: $str"                                        >> $str
  99. echo "Version: $libfm_version-$libfm_release"               >> $str
  100. echo "Provides: $str"                                       >> $str
  101. echo "Replaces: $str"                                       >> $str
  102. echo "Architecture: all"                                    >> $str
  103. echo "Description: This dummy packge fakes to provide $str" >> $str
  104.  
  105. equivs-build $str
  106. sudo dpkg -i "$str"_"$libfm_version-$libfm_release"_all.deb
  107.  
  108. str=libfm-gtk4
  109. echo "Section: misc"                                         > $str
  110. echo "Priority: optional"                                   >> $str
  111. echo "Standards-Version: 3.9.2"                             >> $str
  112. echo "Package: $str"                                        >> $str
  113. echo "Version: $libfm_version-$libfm_release"               >> $str
  114. echo "Provides: $str"                                       >> $str
  115. echo "Replaces: $str"                                       >> $str
  116. echo "Architecture: all"                                    >> $str
  117. echo "Description: This dummy packge fakes to provide $str" >> $str
  118.  
  119. equivs-build $str
  120. sudo dpkg -i "$str"_"$libfm_version-$libfm_release"_all.deb
  121.  
  122. str=libfm-modules
  123. echo "Section: misc"                                         > $str
  124. echo "Priority: optional"                                   >> $str
  125. echo "Standards-Version: 3.9.2"                             >> $str
  126. echo "Package: $str"                                        >> $str
  127. echo "Version: $libfm_version-$libfm_release"               >> $str
  128. echo "Provides: $str"                                       >> $str
  129. echo "Replaces: $str"                                       >> $str
  130. echo "Architecture: all"                                    >> $str
  131. echo "Description: This dummy packge fakes to provide $str" >> $str
  132.  
  133. equivs-build $str
  134. sudo dpkg -i "$str"_"$libfm_version-$libfm_release"_all.deb
  135.  
  136. str=libfm4
  137. echo "Section: misc"                                         > $str
  138. echo "Priority: optional"                                   >> $str
  139. echo "Standards-Version: 3.9.2"                             >> $str
  140. echo "Package: $str"                                        >> $str
  141. echo "Version: $libfm_version-$libfm_release"               >> $str
  142. echo "Provides: $str"                                       >> $str
  143. echo "Replaces: $str"                                       >> $str
  144. echo "Architecture: all"                                    >> $str
  145. echo "Description: This dummy packge fakes to provide $str" >> $str
  146.  
  147. equivs-build $str
  148. sudo dpkg -i "$str"_"$libfm_version-$libfm_release"_all.deb
  149.  
  150. sudo apt-get install libmenu-cache3 libmenu-cache-dev libmenu-cache-bin
  151. sudo dpkg -i libfm-gtk-git_"$libfm_version-$libfm_release"_*.deb
  152. exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement