Refactor to allow ytfeed an installer
This commit is contained in:
		
							parent
							
								
									7b41970358
								
							
						
					
					
						commit
						37b86e5cbb
					
				
							
								
								
									
										2
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								Makefile
									
									
									
									
									
								
							@ -11,7 +11,7 @@ clean:
 | 
			
		||||
 | 
			
		||||
.PHONY: test
 | 
			
		||||
test: menu
 | 
			
		||||
	./menu <test
 | 
			
		||||
	./menu <examples/installation-helper
 | 
			
		||||
 | 
			
		||||
.PHONY: install
 | 
			
		||||
install: menu
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										3
									
								
								README
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								README
									
									
									
									
									
								
							@ -16,9 +16,6 @@ on its own with rustc(1). It's recommended to run the test program:
 | 
			
		||||
 | 
			
		||||
```sh
 | 
			
		||||
make test
 | 
			
		||||
 | 
			
		||||
# or test using menu(1)'s shebang
 | 
			
		||||
./test
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										28
									
								
								examples/Makefile.ytfeed
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										28
									
								
								examples/Makefile.ytfeed
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,28 @@
 | 
			
		||||
PREFIX ?= /usr/local
 | 
			
		||||
 | 
			
		||||
# Sorry, there might be a better way to do this but it would take more time
 | 
			
		||||
# than typing it out.
 | 
			
		||||
 | 
			
		||||
.PHONY: install
 | 
			
		||||
install:
 | 
			
		||||
	install -m 755 \
 | 
			
		||||
			ytfeed \
 | 
			
		||||
			ytfeed.aggregate \
 | 
			
		||||
			ytfeed.browse-entry \
 | 
			
		||||
			ytfeed.browse-feed \
 | 
			
		||||
			ytfeed.browse-feeds \
 | 
			
		||||
			ytfeed.dl \
 | 
			
		||||
		$(PREFIX)/bin
 | 
			
		||||
 | 
			
		||||
.PHONY: launcher
 | 
			
		||||
launcher:
 | 
			
		||||
	../menu <ytfeed.launcher
 | 
			
		||||
 | 
			
		||||
.PHONY: uninstall
 | 
			
		||||
uninstall:
 | 
			
		||||
	rm -f $(PREFIX)/bin/ytfeed \
 | 
			
		||||
		$(PREFIX)/bin/ytfeed.aggregate \
 | 
			
		||||
		$(PREFIX)/bin/ytfeed.browse-entry \
 | 
			
		||||
		$(PREFIX)/bin/ytfeed.browse-feed \
 | 
			
		||||
		$(PREFIX)/bin/ytfeed.browse-feeds \
 | 
			
		||||
		$(PREFIX)/bin/ytfeed.dl
 | 
			
		||||
@ -1,19 +1,23 @@
 | 
			
		||||
#!./menu
 | 
			
		||||
#!usr/bin/env menu
 | 
			
		||||
 | 
			
		||||
$ echo Hello, world.
 | 
			
		||||
 | 
			
		||||
# ^^^ Text   VVV Command
 | 
			
		||||
	echo Hello, world.
 | 
			
		||||
 | 
			
		||||
$ cat Makefile
 | 
			
		||||
 | 
			
		||||
# And this is the Attributes line, which is yet unused.
 | 
			
		||||
	cat Makefile
 | 
			
		||||
 | 
			
		||||
$ less <menu.rs
 | 
			
		||||
$ cat examples/installation-helper
 | 
			
		||||
# Technically this line is skipped entirely by menu(1).
 | 
			
		||||
	cat examples/installation-helper
 | 
			
		||||
 | 
			
		||||
$ less <menu.rs
 | 
			
		||||
# But comments will be allowed here, they'll start with hash.
 | 
			
		||||
	less <menu.rs
 | 
			
		||||
 | 
			
		||||
Remove menu and re-build it.
 | 
			
		||||
 | 
			
		||||
# Don't start the attributes line with a tab; it'll break in later versions.
 | 
			
		||||
	rm -f menu; make
 | 
			
		||||
 | 
			
		||||
Install menu to /usr/local/ (assuming adequate permissions).
 | 
			
		||||
@ -34,4 +38,4 @@ Uninstall menu from /usr/local (using sudo(8)).
 | 
			
		||||
 | 
			
		||||
Open the ytfeed launcher.
 | 
			
		||||
 | 
			
		||||
	make -C examples -f Makefile.ytfeed
 | 
			
		||||
	make -C examples -f Makefile.ytfeed launcher
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										13
									
								
								examples/ytfeed.launcher
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										13
									
								
								examples/ytfeed.launcher
									
									
									
									
									
										Executable file
									
								
							@ -0,0 +1,13 @@
 | 
			
		||||
#!/usr/bin/env menu
 | 
			
		||||
 | 
			
		||||
$ cat Makefile.ytfeed
 | 
			
		||||
 | 
			
		||||
	cat Makefile.ytfeed
 | 
			
		||||
 | 
			
		||||
$ make -f Makefile.ytfeed install
 | 
			
		||||
 | 
			
		||||
	make -f Makefile.ytfeed install
 | 
			
		||||
 | 
			
		||||
$ make -f Makefile.ytfeed uninstall
 | 
			
		||||
 | 
			
		||||
	make -f Makefile.ytfeed uninstall
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user