summaryrefslogtreecommitdiff
path: root/Justfile
blob: 5f5385cd3077652291c274072ee40ade973f7bf1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
NAME := "loadbars"
VERSION := "0.7.5"

default: version perltidy

version:
    echo {{VERSION}} > .version

profile:
    perl -d:NYTProf loadbars --hosts localhost
    nytprofhtml nytprof.out

perltidy:
    find . -name \*.pm | xargs perltidy -b
    perltidy -b {{NAME}}
    find . -name \*.bak -delete

install DESTDIR="":
    #!/usr/bin/env bash
    if [ ! -d "{{DESTDIR}}/usr/bin" ]; then
        mkdir -p {{DESTDIR}}/usr/bin
    fi
    if [ ! -d "{{DESTDIR}}/usr/share/{{NAME}}" ]; then
        mkdir -p {{DESTDIR}}/usr/share/{{NAME}}
    fi
    cp {{NAME}} {{DESTDIR}}/usr/bin
    cp -r ./lib {{DESTDIR}}/usr/share/{{NAME}}/lib
    cp -r ./fonts {{DESTDIR}}/usr/share/{{NAME}}/fonts
    cp ./.version {{DESTDIR}}/usr/share/{{NAME}}/version

deinstall DESTDIR="":
    #!/usr/bin/env bash
    if [ -n "{{DESTDIR}}" ] && [ -f "{{DESTDIR}}/usr/bin/{{NAME}}" ]; then
        rm {{DESTDIR}}/usr/bin/{{NAME}}
    fi
    if [ -n "{{DESTDIR}}" ] && [ -d "{{DESTDIR}}/usr/share/{{NAME}}" ]; then
        rm -r {{DESTDIR}}/usr/share/{{NAME}}
    fi

clean:
    #!/usr/bin/env bash
    if [ -f nytprof.out ]; then
        rm nytprof.out
    fi
    if [ -f tmon.out ]; then
        rm tmon.out
    fi
    if [ -d nytprof ]; then
        rm -Rf nytprof
    fi

release: version perltidy
    git add -A
    git commit -m 'New release {{VERSION}}'
    git tag {{VERSION}}
    git push --tags
    git push origin master