Make it possible to use PluginLoader without store
[cascardo/ipsilon.git] / Makefile
1 RPMBUILD = $(PWD)/dist/rpmbuild
2
3 all: testdeps lint pep8 test
4         echo "All tests passed"
5
6 testdeps:
7         # Determine if test deps are installed
8         # First, some binaries
9         which lessc
10         which pylint
11         which pep8
12         which httpd
13         which postgres
14         which openssl
15         which slapd
16         # Now, python libraries
17         python -c 'import openid'
18         python -c 'import openid_teams'
19         python -c 'import openid_cla'
20         python -c 'import cherrypy'
21         python -c 'import M2Crypto'
22         python -c 'import lasso'
23         python -c 'import sqlalchemy'
24         python -c 'import ldap'
25         python -c 'import pam'
26         python -c 'import fedora'
27         python -c 'import ipapython'
28         python -c 'import jinja2'
29         python -c 'import psycopg2'
30         # And now everything else
31         ls /usr/share/doc/sssd
32         ls /usr/lib64/libsss_simpleifp.so.0
33         ls /usr/lib64/httpd/modules/mod_wsgi.so
34         ls /usr/libexec/mod_auth_mellon
35
36 lint:
37         # Analyze code
38         # don't show recommendations, info, comments, report
39         # W0613 - unused argument
40         # Ignore cherrypy class members as they are dynamically added
41         # Ignore IPA API class members as they are dynamically added
42         pylint -d c,r,i,W0613 -r n -f colorized \
43                    --notes= \
44                    --ignored-classes=cherrypy,API \
45                    --disable=star-args \
46                    ./ipsilon
47
48 pep8:
49         # Check style consistency
50         pep8 ipsilon
51
52 # Requires python-lesscpy
53 ui: less/ipsilon.less less/admin.less
54         # Create CSS
55         lesscpy less/ipsilon.less > ui/css/ipsilon.css
56         lesscpy less/admin.less > ui/css/admin.css
57         lesscpy less/styles.less > ui/css/styles.css
58
59 # Requires NodeJS less and clear-css packages
60 # Should be removed when lesscpy starts to work properly
61 ui-node: less/ipsilon.less less/admin.less
62
63         # Create and minify CSS
64         #lessc --clean-css less/ipsilon.less ui/css/ipsilon.css
65         #lessc --clean-css less/admin.less ui/css/admin.css
66
67         # FIXME: temporarily disable clean-css for development
68         lessc less/ipsilon.less ui/css/ipsilon.css
69         lessc less/admin.less ui/css/admin.css
70         lessc less/styles.less ui/css/styles.css
71         lessc less/patternfly/patternfly.less ui/css/patternfly.css
72
73 clean:
74         rm -fr testdir cscope.out
75         find ./ -name '*.pyc' -exec rm -f {} \;
76
77 cscope:
78         git ls-files | xargs pycscope
79
80 lp-test:
81         pylint -d c,r,i,W0613 -r n -f colorized \
82                    --notes= \
83                    --ignored-classes=cherrypy \
84                    --disable=star-args \
85                    ./tests
86         pep8 tests
87
88 wrappers:
89         #rm -fr wrapdir
90         #mkdir wrapdir
91         #LD_PRELOAD=libsocket_wrapper.so
92         #SOCKET_WRAPPER_DIR=wrapdir
93         #SOCKET_WRAPPER_DEFAULT_IFACE=9
94
95 tests: wrappers
96         rm -rf testdir
97         PYTHONPATH=./ ./tests/tests.py --test=test1
98         PYTHONPATH=./ ./tests/tests.py --test=testlogout
99         PYTHONPATH=./ ./tests/tests.py --test=testnameid
100         PYTHONPATH=./ ./tests/tests.py --test=testrest
101         PYTHONPATH=./ ./tests/tests.py --test=testmapping
102         PYTHONPATH=./ ./tests/tests.py --test=testgssapi
103         PYTHONPATH=./ ./tests/tests.py --test=attrs
104         PYTHONPATH=./ ./tests/tests.py --test=trans
105         PYTHONPATH=./ ./tests/tests.py --test=pgdb
106         PYTHONPATH=./ ./tests/tests.py --test=fconf
107         PYTHONPATH=./ ./tests/tests.py --test=ldap
108         PYTHONPATH=./ ./tests/tests.py --test=ldapdown
109         PYTHONPATH=./ ./tests/tests.py --test=openid
110         PYTHONPATH=./ ./tests/tests.py --test=dbupgrades
111
112 test: lp-test unittests tests
113
114 unittests:
115         PYTHONPATH=./ ./ipsilon/tools/saml2metadata.py
116         PYTHONPATH=./ python ./ipsilon/util/policy.py
117
118 sdist:
119         python setup.py sdist
120
121 rpmroot:
122         rm -rf $(RPMBUILD)
123         mkdir -p $(RPMBUILD)/BUILD
124         mkdir -p $(RPMBUILD)/RPMS
125         mkdir -p $(RPMBUILD)/SOURCES
126         mkdir -p $(RPMBUILD)/SPECS
127         mkdir -p $(RPMBUILD)/SRPMS
128
129 rpmdistdir:
130         mkdir -p dist/rpms
131         mkdir -p dist/srpms
132
133 rpms: rpmroot rpmdistdir sdist
134         cp dist/ipsilon*.tar.gz $(RPMBUILD)/SOURCES/
135         rpmbuild --define "gittag .git`git rev-parse --short HEAD`" --define "builddate .`date +%Y%m%d%H%M`" --define "_topdir $(RPMBUILD)" -ba contrib/fedora/ipsilon.spec
136         mv $(RPMBUILD)/RPMS/*/ipsilon-*.rpm dist/rpms/
137         mv $(RPMBUILD)/SRPMS/ipsilon-*.src.rpm dist/srpms/
138         rm -rf $(RPMBUILD)
139
140 releaserpms: rpmroot rpmdistdir sdist
141         cp dist/ipsilon*.tar.gz $(RPMBUILD)/SOURCES/
142         rpmbuild --define "_topdir $(RPMBUILD)" -ba contrib/fedora/ipsilon.spec
143         mv $(RPMBUILD)/RPMS/*/ipsilon-*.rpm dist/rpms/
144         mv $(RPMBUILD)/SRPMS/ipsilon-*.src.rpm dist/srpms/
145         rm -rf $(RPMBUILD)