updated on Mon Jan 16 00:01:41 UTC 2012
[aur-mirror.git] / smooth-tasks / PKGBUILD
bloba0e7cf7edbfdf61c7347af4fda24fc0ba9820923
1 # Maintainer: Dylon Edwards <deltaecho@archlinux.us>
3 pkgname=smooth-tasks
4 pkgver=wip_2010_11_06
5 pkgrel=3
7 url="http://kde-look.org/content/show.php/Smooth+Tasks?content=101586"
8 pkgdesc="A taskbar replacement Plasmoid with window peeking similar to Windows 7."
9 license=('GPLv2')
11 arch=('x86_64' 'i686')
13 # Added an extra '_' to the following variables to override makepkg's default versioning scheme
14 __hgroot="https://bitbucket.org/panzi"
15 __hgrepo="smooth-tasks"
17 source=('Applet.cpp.patch')
18 md5sums=('4261d47f5ec73593fa542a56f9aad6a3')
20 depends=('kdebase-workspace>=4.7.0')
21 makedepends=('automoc4' 'cmake' 'mercurial' 'coreutils' 'perl')
23 ### NOTE ###################################################
24 # To get the most up-to-date version of this plasmoid, you #
25 # don't have to wait for me to update the PKGBUILD -- the  #
26 # way I've engineered it, simply running `makepkg -f' is   #
27 # enough.                                                  #
28 ############################################################
30 function build() 
32         # Checkout / Update the plasmoid's source
33         if [[ -d "${__hgrepo}/.hg" ]]; then
34                 ( cd "${__hgrepo}" && hg pull -u )
35         else
36                 hg clone "${__hgroot}/${__hgrepo}"
37         fi
39         # Copy the source to a build directory
40         cp -a "${__hgrepo}" "${__hgrepo}-build" &&
41         cd "${__hgrepo}-build" || return 1
43         patch -Np0 -i ../Applet.cpp.patch || return 1
45         # Compile the plasmoid
46         cmake . -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release || return 1
47         make || return 1
49         # Hack to get the correct pkgver :)
50         pkgver="$(head -n 1 ChangeLog | perl -pe 's|^.*(wip)\s+(\d{4})-(\d{2})-(\d{2}).*$|\1_\2_\3_\4|')"
52         # Make sure the pkgver is not null
53         if [[ -n "${pkgver}" ]]; then
54                 export pkgver="${pkgver}"
55                 echo "${pkgver}" > "${pkgname}-pkgver.txt"
56         fi
59 function package()
61         cd "${__hgrepo}-build"
63         # Install the plasmoid
64         make DESTDIR="${pkgdir}" install || return 1
66         # Get the correct pkgver
67         if [[ -f "${pkgname}-pkgver.txt" ]]; then
68                 pkgver="$(cat ${pkgname}-pkgver.txt)"
70                 # Export the pkgver if it is not null
71                 if [[ -n "${pkgver}" ]]; then
72                         export pkgver="${pkgver}"
73         
74                         # Set the correct pkgver in the PKGBUILD
75                         perl -pi -e "s|^(\t?)pkgver=wip_\d{4}_\d{2}_\d{2}$|\1pkgver=${pkgver}|g" "${startdir}/PKGBUILD"
76                 fi
77         fi
79         # Remove the build directory
80         cd "${srcdir}" &&
81         rm -rf "${__hgrepo}-build"
83         # A little something for the AUR ...
84         :<<-'EOF'
85         pkgver=wip_2010_11_06
86         EOF