Browse Source

build overhaul

parazyd 2 years ago
parent
commit
f57b50526d
10 changed files with 57 additions and 53 deletions
  1. 16 20
      Makefile
  2. 8 0
      config.mk
  3. 7 2
      finance.py
  4. 2 2
      header.html
  5. 1 1
      nav.html
  6. 2 2
      news/2017/04/on-grsec.html.md
  7. 2 1
      news/2017/06/rmll2017.html.md
  8. 1 1
      news/2017/10/index.html.md
  9. 7 11
      rsync-exclude
  10. 11 13
      wiki/faq/index.html.md

+ 16 - 20
Makefile

@@ -1,27 +1,23 @@
1
-DESTDIR = /var/www/html
1
+include config.mk
2 2
 
3
-all: clean
4
-	@./mars generate
5
-	@./hack
3
+all: $(PAGES)
6 4
 	@./atom.sh
5
+	@./finance.py
7 6
 
8
-push: all
9
-	@./mars push -f
10
-	@sed -i webtree \
11
-		-e 's@WEBHOST=.*@WEBHOST="parazyd.cf"@' \
12
-		-e 's@WEBROOT=.*@WEBROOT="public_html/heads.dyne.org"@'
13
-	@./mars push -f
14
-	@sed -i webtree \
15
-		-e 's@WEBHOST=.*@WEBHOST="heads.dyne.org"@' \
16
-		-e 's@WEBROOT=.*@WEBROOT="/srv/www/heads"@'
7
+%: %.md
8
+	@echo " * generating $@"
9
+	@cat header.html nav.html | \
10
+		sed "s/DEFAULT_TITLE/$(shell sed 1q $^) | heads/" > $@
11
+	@$(MARKDOWN) $^ >> $@
12
+	@cat footer.html >> $@
17 13
 
18 14
 clean:
19
-	@./mars clean -f
15
+	rm -f $(PAGES) atom.xml finance.html
20 16
 
21
-install:
22
-	cp -f Makefile      ${DESTDIR}/Makefile
23
-	cp -f mars          ${DESTDIR}/mars
24
-	cp -f rsync-exclude ${DESTDIR}/rsync-exclude
25
-	cp -f webtree       ${DESTDIR}/webtree
17
+push: all
18
+	@echo " * pushing to $(WEBHOST):$(WEBROOT)"
19
+	@rsync -P -e "ssh" -avul --delete --stats \
20
+		--exclude-from "rsync-exclude" \
21
+		. $(WEBHOST):$(WEBROOT)
26 22
 
27
-.PHONY: all push clean install
23
+.PHONY: all clean push

+ 8 - 0
config.mk

@@ -0,0 +1,8 @@
1
+MARKDOWN = smu
2
+
3
+WEBHOST ?= heads.dyne.org
4
+WEBROOT ?= public_html/heads.dyne.org
5
+
6
+
7
+MDS = $(shell find . -type f -name '*.html.md' -print)
8
+PAGES = $(MDS:.md=)

+ 7 - 2
finance.py

@@ -2,6 +2,7 @@
2 2
 # Keeps count of my beers.
3 3
 
4 4
 from os.path import join
5
+from time import gmtime, strftime
5 6
 from urllib.request import urlopen
6 7
 
7 8
 
@@ -22,18 +23,22 @@ usd = float(urlopen(join(api, '24hrprice')).read())
22 23
 
23 24
 icandrink = total * usd
24 25
 
25
-cnt = 0
26
+cnt, tot = 0, 0
26 27
 beers = []
27 28
 while icandrink > 0:
28 29
     icandrink -= 2.5
29
-    beers.append('<img src="static/beer11.png" alt="a cold beer">')
30
+    beers.append('<img src="static/beer11.png" alt="a cold beer" width="24">')
30 31
     cnt += 1
32
+    tot += 1
31 33
     if cnt == 20:
32 34
         beers.append('<br>')
33 35
         cnt = 0
34 36
 
35 37
 page = "<h2>heads' financial report</h2>\n"
38
+page += '<h4>%s</h4>\n' % strftime('%a, %d %b %Y %H:%M:%S %z', gmtime())
39
+page += '<a href="/finance.py"><h4>generated with a script</h4></a>\n'
36 40
 page += '\n'.join(beers) + '\n'
41
+page += '<p>beer count: %d</p>\n' % tot
37 42
 
38 43
 with open('finance.html', 'w') as f:
39 44
     f.write(page)

+ 2 - 2
header.html

@@ -2,7 +2,7 @@
2 2
 <html lang="en">
3 3
 <head>
4 4
 	<meta charset="utf-8">
5
-	<meta name="description" content="heads, a libre privacy linux distro">
5
+	<meta name="description" content="heads, the libre privacy linux distro">
6 6
 	<title>DEFAULT_TITLE</title>
7 7
 	<link rel="stylesheet" type="text/css" href="static/style.css">
8 8
 	<link rel="shortcut icon" href="static/favicon.ico" type="image/icon">
@@ -12,6 +12,6 @@
12 12
 </head>
13 13
 	<div id="header">
14 14
     <!-- <span class="logo">表</span> -->
15
-    <span class="logo"><a href="/"><img width="50" src="static/logo_big.png"></a></span>
15
+    <span class="logo"><a href="/"><img width="50" src="static/logo_big.png" alt="表"></a></span>
16 16
     <a id="headerLink" href="/">heads</a> <span id="headerSubtitle">::: the libre privacy distro</span>
17 17
 	</div>

+ 1 - 1
nav.html

@@ -1,6 +1,6 @@
1 1
 	<div id="menu">
2 2
 		<span class="left">
3
-			<a class="thisSite" href="/">home</a>
3
+			<a href="/">home</a>
4 4
 			<a href="/news/">news</a>
5 5
 			<a href="/download/">download</a>
6 6
 			<a href="https://github.com/headslive/">git</a>

+ 2 - 2
news/2017/04/on-grsec.html.md

@@ -4,12 +4,12 @@ On grsec and status of heads
4 4
 After all the rumors, unfortunately today it was made true.
5 5
 
6 6
 Grsecurity is no longer publishing public testing patches:
7
-[https://grsecurity.net/passing_the_baton.php](https://grsecurity.net/passing_the_baton.php)
7
+[https://grsecurity.net/passing\_the\_baton.php](https://grsecurity.net/passing_the_baton.php)
8 8
 
9 9
 Personally I am very unhappy because of this move, but it is very understandable
10 10
 when looking it from grsec's side. People have often tried to (badly) upstream
11 11
 some of their patches, and never contributed back, or credited Grsecurity for
12
-the work done. Spender & co. have had enough of it. 
12
+the work done. Spender & co. have had enough of it.
13 13
 
14 14
 
15 15
 What does this mean for heads?

+ 2 - 1
news/2017/06/rmll2017.html.md

@@ -8,7 +8,8 @@ For anyone that's interested, of course :)
8 8
 I will be holding a workshop on heads at RMLL2017. It is a libre
9 9
 software meeting that will be held in Saint-Etienne, France over the
10 10
 course of a week: 1-7 July, 2017. Information on RMLL2017 can be found
11
-on their respective website: https://2017.rmll.info/en/
11
+on their respective website:
12
+[https://2017.rmll.info/en/](https://2017.rmll.info/en/)
12 13
 
13 14
 The schedule of the entire meeting is here (make sure you go through
14 15
 the navigation on the left):

+ 1 - 1
news/2017/10/index.html.md

@@ -1,4 +1,4 @@
1 1
 October 2017 news archive
2
-======================
2
+=========================
3 3
 
4 4
 * [Status report](statusreport.html) (2017-10-25)

+ 7 - 11
rsync-exclude

@@ -1,15 +1,11 @@
1 1
 rsync-exclude
2
-atom.sh
3
-hack
4
-*.php
5 2
 .git
6
-.gitignore
7
-Makefile
8
-.gitignore
9
-*.swp
10
-mars
11
-*.md
12
-webtree
13 3
 README.md
14
-pushweb.sh
15 4
 LICENSE
5
+Makefile
6
+config.mk
7
+*.html.md
8
+atom.sh
9
+header.html
10
+nav.html
11
+footer.html

+ 11 - 13
wiki/faq/index.html.md

@@ -1,21 +1,19 @@
1
-##+TITLE faq :: heads wiki
2
-
3 1
 frequent annoying questions
4 2
 ===========================
5 3
 
6
-### <a id="login" href="#login"><img src="/static/anchor.svg" class="anchor"></a> What are the login credentials?
4
+### <a id="login" href="#login"><img src="/static/anchor.svg" class="anchor" alt="•"></a> What are the login credentials?
7 5
 
8 6
 root:toor
9 7
 
10 8
 luther:luther
11 9
 
12 10
 
13
-### <a id="typo" href="#typo"><img src="/static/anchor.svg" class="anchor"></a> Why is it _heads_ and not _Heads_?
11
+### <a id="typo" href="#typo"><img src="/static/anchor.svg" class="anchor" alt="•"></a> Why is it _heads_ and not _Heads_?
14 12
 
15
-So you can ask an annoying question.
13
+Because I said so.
16 14
 
17 15
 
18
-### <a id="branding" href="#branding"><img src="/static/anchor.svg" class="anchor"></a> Why is there no branding, logos, etc. in the OS?
16
+### <a id="branding" href="#branding"><img src="/static/anchor.svg" class="anchor" alt="•"></a> Why is there no branding, logos, etc. in the OS?
19 17
 
20 18
 heads is intended as a distro for privacy-aware people. You don't want
21 19
 to go out with a system screaming "Hey, I'm using heads!!!". So an
@@ -23,19 +21,19 @@ elegant and lean looking solution is there in the form of dark colours
23 21
 and a lovely wallpaper.
24 22
 
25 23
 
26
-### <a id="where-to-get-help" href="#where-to-get-help"><img src="/static/anchor.svg" class="anchor"></a> Where do I get help for using heads?
24
+### <a id="where-to-get-help" href="#where-to-get-help"><img src="/static/anchor.svg" class="anchor" alt="•"></a> Where do I get help for using heads?
27 25
 
28 26
 Please don't ask for help on the bugtracker. You can get help and talk
29 27
 with other heads users via [IRC](/irc.html), and via the
30 28
 [mailing list](https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/heads).
31 29
 
32 30
 
33
-### <a id="how-to-donate" href="#how-to-donate"><img src="/static/anchor.svg" class="anchor"></a> How do I donate?
31
+### <a id="how-to-donate" href="#how-to-donate"><img src="/static/anchor.svg" class="anchor" alt="•"></a> How do I donate?
34 32
 
35 33
 See [contributing](/contribute.html).
36 34
 
37 35
 
38
-### <a id="similar-to-heads" href="#similar-to-heads"><img src="/static/anchor.svg" class="anchor"></a> Are there any projects similar to heads?
36
+### <a id="similar-to-heads" href="#similar-to-heads"><img src="/static/anchor.svg" class="anchor" alt="•"></a> Are there any projects similar to heads?
39 37
 
40 38
 Of course! Decentralization is key :)
41 39
 
@@ -49,14 +47,14 @@ Here's a few notable projects, both privacy-wise and/or security-wise:
49 47
 * [Whonix](https://www.whonix.org/)
50 48
 
51 49
 
52
-### <a id="i-found-a-bug" href="#i-found-a-bug"><img src="/static/anchor.svg" class="anchor"></a> I found a bug! What do I do?
50
+### <a id="i-found-a-bug" href="#i-found-a-bug"><img src="/static/anchor.svg" class="anchor" alt="•"></a> I found a bug! What do I do?
53 51
 
54 52
 Go to [heads' bugtracker](https://github.com/headslive/bugtracker/issues)
55 53
 and search through the issues. If your bug isn't already reported, open
56 54
 a new issue and try to explain it the best you can.
57 55
 
58 56
 
59
-### <a id="why-isnt-foo-here" href="#why-isnt-foo-here"><img src="/static/anchor.svg" class="anchor"></a> Why is _foo_ not in heads?
57
+### <a id="why-isnt-foo-here" href="#why-isnt-foo-here"><img src="/static/anchor.svg" class="anchor" alt="•"></a> Why is _foo_ not in heads?
60 58
 
61 59
 The distro is very fresh. I am getting feedback as people are giving it.
62 60
 Feel free to open a feature request on the
@@ -64,7 +62,7 @@ Feel free to open a feature request on the
64 62
 with **feature request**.
65 63
 
66 64
 
67
-### <a id="how-do-i-update-heads" href="#how-do-i-update-heads"><img src="/static/anchor.svg" class="anchor"></a> How do I update heads?
65
+### <a id="how-do-i-update-heads" href="#how-do-i-update-heads"><img src="/static/anchor.svg" class="anchor" alt="•"></a> How do I update heads?
68 66
 
69 67
 First check you are running the latest version of heads. The version you
70 68
 have should be the same as it is on the [downloads page](/download/). If
@@ -73,7 +71,7 @@ to see if there are any minor system updates. However, if you don't have
73 71
 the latest ISO, just grab that :)
74 72
 
75 73
 
76
-### <a id="what-is-the-root-password" href="#what-is-the-root-password"><img src="/static/anchor.svg" class="anchor"></a> What is the root password?
74
+### <a id="what-is-the-root-password" href="#what-is-the-root-password"><img src="/static/anchor.svg" class="anchor" alt="•"></a> What is the root password?
77 75
 
78 76
 You saw it when you opened a terminal for the first time in the session.
79 77
 It is only shown once at this time and then it disappears (as it told