Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Complete _oasis with more metadata & version constraints #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
108 changes: 80 additions & 28 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,45 +1,97 @@
# Copyright (c) 2015 Richard Mortier <mort@cantab.net>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

-include Makefile.config

# OASIS_START
# DO NOT EDIT (digest: a3c674b4239234cbbe53afe090018954)
NAME = $(shell oasis query name)
VERSION = $(shell oasis query version)

SETUP = ocaml setup.ml
all byte native build: configure
ocaml setup.ml -build

build: setup.data
$(SETUP) -build $(BUILDFLAGS)
lib: build reinstall
[ ! -r bin/Makefile ] && mirage configure --no-depext bin/config.ml || true
mirage clean bin/config.ml

doc: setup.data build
$(SETUP) -doc $(DOCFLAGS)
tftpd: bin/tftpd
bin/tftpd: bin/config.ml bin/tftpd.ml
[ ! -r bin/Makefile ] && \
mirage configure --unix bin/config.ml || true
mirage build bin/config.ml
cp bin/_build/main.native bin/tftpd

test: setup.data build
$(SETUP) -test $(TESTFLAGS)
configure setup.data: setup.ml
ocaml $< -configure --enable-tests

all:
$(SETUP) -all $(ALLFLAGS)
setup: setup.ml
setup.ml: _oasis
oasis setup

install: setup.data
$(SETUP) -install $(INSTALLFLAGS)
test doc install uninstall reinstall: all
ocaml setup.ml -$@

uninstall: setup.data
$(SETUP) -uninstall $(UNINSTALLFLAGS)
## Documentation

reinstall: setup.data
$(SETUP) -reinstall $(REINSTALLFLAGS)
doc/html/.git:
mkdir -p doc/html
cd doc/html && ( \
git init && \
git remote add origin git@github.com:mor1/ocaml-tftp.git && \
git checkout -B gh-pages \
)

clean:
$(SETUP) -clean $(CLEANFLAGS)
gh-pages: doc/html/.git
cd doc/html && git checkout -B gh-pages
rm -f doc/html/*
$(MAKE) doc && cp tftp.docdir/* doc/html/
cd doc/html && ( \
git add * && \
git commit -a -m "Documentation updates" && \
git push origin gh-pages \
)

distclean:
$(SETUP) -distclean $(DISTCLEANFLAGS)
## Publish

ARCHIVE = https://github.com/mor1/ocaml-tftp/archive/$(VERSION).tar.gz

opam: release publish pr

setup.data:
$(SETUP) -configure $(CONFIGUREFLAGS)
release:
git tag -a $(VERSION) -m "Version $(VERSION)."
git push upstream $(VERSION)

configure:
$(SETUP) -configure $(CONFIGUREFLAGS)
publish:
OPAMYES=1 opam pin add -n .
opam publish prepare $(NAME).$(VERSION) $(ARCHIVE)

.PHONY: build doc test all install uninstall reinstall clean distclean configure
pr:
OPAMYES=1 opam pin add -n $(NAME) $(NAME).$(VERSION)
opam publish submit $(NAME).$(VERSION) && $(RM) -r $(NAME).$(VERSION)

# OASIS_STOP

-include Makefile.local
## Clean

clean:
ocaml setup.ml -clean
[ -r bin/Makefile ] && mirage clean bin/config.ml || true
$(RM) log bin/tftpd

distclean:
ocaml setup.ml -distclean
oasis setup-clean
$(RM) setup.* _tags configure myocamlbuild.ml
$(RM) lib/META lib/*.ml*lib lib/*.mlpack

.PHONY: all byte native build doc test install uninstall reinstall \
clean distclean configure setup
83 changes: 0 additions & 83 deletions Makefile.local

This file was deleted.

19 changes: 16 additions & 3 deletions _oasis
Original file line number Diff line number Diff line change
@@ -1,25 +1,32 @@
OASISFormat: 0.4
Name: tftp
Version: 0.1.3
Synopsis: Trivial FTP
Synopsis: A TFTP library and Mirage unikernel
Description: A basic implementation of the
[Trivial FTP](https://tools.ietf.org/html/rfc1350)
protocol. Provides separate wire parsing and server libraries, plus a
[MirageOS](https://mirage.io/) unikernel server implementation.
Authors: Richard Mortier
Maintainers: Richard Mortier <mort@cantab.net>
Homepage: https://github.com/mor1/ocaml-tftp
License: ISC
Plugins: META (0.4), DevFiles (0.4)
BuildTools: ocamlbuild
OCamlVersion: >= 4.01.0

Library "tftp-wire"
Path: lib/
FindlibName: wire
FindlibParent: tftp
Modules: Wire
BuildDepends: cstruct, cstruct.syntax
BuildDepends: cstruct (>= 1.0.1), cstruct.syntax

Library "tftp"
Path: lib/
Pack: true
Findlibname: tftp
Modules: S
BuildDepends: mirage, lwt, tftp.wire, io-page
BuildDepends: mirage (>= 2.5.0), lwt (>= 2.4.7), tftp.wire, io-page

Document tftp
Title: TFTP docs
Expand All @@ -28,3 +35,9 @@ Document tftp
Install: true
XOCamlbuildPath: lib/
XOCamlbuildLibraries: tftp.wire, tftp


SourceRepository master
Type: git
Location: https://github.com/mor1/ocaml-tftp.git
Browser: https://github.com/mor1/ocaml-tftp