Distribution settings for LightDM
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

functions.sh 2.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. #!/bin/bash
  2. # source version info
  3. function source_version_info {
  4. if [ -f VERSION ]; then
  5. . ./VERSION
  6. else
  7. echo "No VERSION-File, exit!"
  8. exit 1
  9. fi
  10. if [ -f FLAVOUR ]; then
  11. . ./FLAVOUR
  12. else
  13. echo "No FLAVOUR-File, exit!"
  14. exit 1
  15. fi
  16. }
  17. # eventually cleanup old builds
  18. function cleanup_old_builds {
  19. if [ -f ./debian/rules ]; then
  20. debclean -d
  21. rm debian/rules
  22. echo "old builds cleaned up, run bootstrap again!"
  23. return 1
  24. fi
  25. }
  26. # debian cleanup
  27. # ==============
  28. function debian_cleanup {
  29. rm -vrf debian/siduction-live-settings-*-*
  30. rm -vrf debian/siduction-settings-*-*
  31. rm -vf debian/files
  32. rm -vf debian/*.init
  33. rm -vf debian/*.install
  34. rm -vf debian/*.lintian-overrides
  35. rm -vf debian/*.log
  36. rm -vf debian/*.postinst
  37. rm -vf debian/*.preinst
  38. rm -vf debian/*.postrm
  39. rm -vf debian/*.service
  40. }
  41. # debian changelog
  42. # ================
  43. function debian_changelog {
  44. if [ ! -f debian/changelog ]; then
  45. sed -e "s/\@CODENAME_SAFE\@/${CODENAME_SAFE}/g" \
  46. -e "s/\@DISTRIBUTION\@/${DISTRIBUTION}/g" \
  47. -e "s/\@VERSION\@/${VERSION}/g" \
  48. -e "s/\@FLAVOUR\@/${FLAVOUR}/g" \
  49. -e "s/\@DISPLAY\@/${DISPLAY}/g" \
  50. ./debtemplate/changelog \
  51. > ./debian/changelog
  52. fi
  53. }
  54. # basic control
  55. # =============
  56. function basic_control {
  57. sed -e "s/\@CODENAME_SAFE\@/${CODENAME_SAFE}/g" \
  58. -e "s/\@DISTRIBUTION\@/${DISTRIBUTION}/g" \
  59. -e "s/\@VERSION\@/${VERSION}/g" \
  60. -e "s/\@FLAVOUR\@/${FLAVOUR}/g" \
  61. -e "s/\@DISPLAY\@/${DISPLAY}/g" \
  62. ./debtemplate/control \
  63. > ./debian/control
  64. }
  65. # grub template
  66. # =============
  67. function grub_template {
  68. mkdir -p ./etc/default/grub.d
  69. sed -e "s/\@CODENAME_SAFE\@/${CODENAME_SAFE}/g" \
  70. -e "s/\@DISTRIBUTION\@/${DISTRIBUTION}/g" \
  71. -e "s/\@VERSION\@/${VERSION}/g" \
  72. -e "s/\@FLAVOUR\@/${1}/g" \
  73. -e "s/\@DISPLAY\@/${DISPLAY}/g" \
  74. ./template/etc/default/grub.d/siduction.cfg \
  75. > ./etc/default/grub.d/siduction.cfg
  76. }
  77. # debian rules
  78. # ============
  79. function debian_rules {
  80. sed -e "s/\@CODENAME_SAFE\@/${CODENAME_SAFE}/g" \
  81. -e "s/\@DISTRIBUTION\@/${DISTRIBUTION}/g" \
  82. -e "s/\@VERSION\@/${VERSION}/g" \
  83. -e "s/\@FLAVOUR\@/${FLAVOUR}/g" \
  84. -e "s/\@DISPLAY\@/${DISPLAY}/g" \
  85. ./debtemplate/rules \
  86. > ./debian/rules
  87. chmod 755 debian/rules
  88. }
  89. # debian_foo_basics
  90. # =================
  91. function debian_foo_basics {
  92. mkdir -p ./debian/source
  93. echo 1.0 > ./debian/source/format
  94. echo 9 > ./debian/compat
  95. }